This topic is locked

Image : width limit

5/6/2010 11:04:53 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way to limit the width (and/or the height) of an image in a list or a view

Thanks very much for your answers
Olivier

Lille (FRANCE)

N
netmedia59 author 5/6/2010

Hey,
I've found the clue !
I have put this in the CSS :

.mainimage1 {

max-width: 400px;

max-height: 400px;

width: expression(this.width > 400 ? "400px" : true);

height: expression(this.height > 400 ? "400px" : true);

}

Of course you can adjust the size !
And this in the list (custom):

$value = "<a href=\"".$data["View"]."\"><img class=\"mainimage1\" src=\"http://www.blabla.com/blabla/".$data["Logo"]."\"; border=0></a>";
Hope it could help !
Olivier

Lille (FRANCE)