View Full Version : onclick image size toggle

03-17-2012, 09:31 PM
hello friends I'm a newbie..

I need a little help. Im using big images in my website. I want a javascript to toggle the image size from "Original size to fit with resolution of screen" and vice versa.

It should be onclick function like this

<img id="blahblah" src="myimage.jpg" onClick="resize();" />

03-18-2012, 05:43 PM
It is better to use images that have a resolution of 72 pixels per inch. Make the conversion on your side first. Things at higher resolution just take longer to load, but does not give any better image on computer screen.

onClick="resize();" Resolution is NOT size! If you want to use smaller picture (thumbnails), make them on your side or just use small height/width on image.