Resizing image using Javascript in IE and FireFox

A couple of weeks ago, I wrote the following code to resize an image with javascript: parseInt( + 20; = parseInt( + 20;

This works perfect in IE. But does not work at all in FireFox. Then I changed it to:

var width = parseInt(;
var height = parseInt(;
width = width – 20;
height = height – 20; width + “px”; = height + “px”;

This works great in FireFox and IE.

Copyright (c) 2007-2019 Ashish Patil . Please read FAQ for more details.

comments powered by Disqus