View Full Version : Resize image in javascript according to browser change.

10-13-2011, 08:19 PM
Basically, i have an image that i want it to be resized when i maximize and change browser size, so it is always centered. I have to use only javascript. I tried many window.resize functions but nothing works. Lets say the image is called 0000.jpg. Anyone has any ideas how to make this?

Thank you in advance.

10-13-2011, 08:33 PM
it would be nice
if you showed
something you tried
and explained in what
way it failed ?

I'm thinkin, handle the
onresize event.

Old Pedant
10-13-2011, 10:48 PM
Really should be done via CSS, in any case. Try to avoid using JavaScript for this.