Quote:
Originally Posted by Mr_love_monkey
try this
Code:
javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid accumulating integer-rounding error */ image.initialHeight=image.height; image.initialWidth=image.width; image.scalingFactor=1; } image.scalingFactor*=amt; image.width=image.scalingFactor*image.initialWidth; image.height=image.scalingFactor*image.initialHeight; } var i,L=document.images.length; for (i=0;i<L;++i) {if (document.images[i].width>800) zoomImage(document.images[i],.5);} if (!L) alert(%22This page contains no images.%22); })();
if you want a different limit just change the 800
|
Cheers dude, much appreciated, greeny headed your way.

I've changed the limit to 750, & the scaling factor to .75, & bound it to a mouse gesture. Thanks to you adding the limit, if the scaling factor isn't enough to reduce a really big image, I can just use the mouse gesture again without shrinking images that aren't too big. Much appreciated.
Quote:
Originally Posted by Mr_love_monkey
also if you want height taken into account you change just replace the bit with the width with
Code:
(document.images[i].width>800 && document.images[i].height>400)
|
Height was never an issue, but thanks anyway.