View Full Version : Limiting sizes in div's

07-10-2007, 03:16 PM

I intend on using this gallery viewer on my site.

Is it possible to make it so that image that is displayed in the div is limited to certain dimensions.. say 100 by 100px. If an image that is displayed is above the limit, the excess is simply just out of view..

I dunno how this would be possible maybe by a use of some sort of mask, i normally code inflash im not sure if taht is possible with divs in html. Or maybe you can limit the size in the js file, if your allowed to.

Any help will be much appreciated thank you

(If your wondering why dont I just use images that are less than 100x100px, it is because, other people will be able to save their imageshack or photobucket links ot the site and using perl be able to display it in the gallery, the size limit needs to be inhibited somehow)

07-11-2007, 03:23 AM
In the javascript you could add a width of 100 to the image tag, though it is generally not a good way to resize an image
var imageHTML='<img src="'+imagepath+'" width="100" style="border-width: 0" />'