K-Meleon

KMeleonWiki > Resources > MacroLibrary > Zoom In & Zoom Out Images

Submitted by: jsnj



Notes: JavaScript from http://www.squarefree.com/bookmarklets/ with assist from MonkeeSage


In Macros:

ZoomInAll?{
menu=Zoom In Images
open("javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ 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; } for (i=0; i<document.images.length; ++i) zoomImage(document.imagesi, 2); })();");
}

ZoomOutAll?{
menu=Zoom Out Images
open("javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ 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; } for (i=0; i<document.images.length; ++i) zoomImage(document.imagesi, .5); })();");
}


In Menus:

# Under &View

macros(ZoomInAll?)
macros(ZoomOutAll?)


In Accelerators:

CTRL Z = macros(ZoomInAll?)
ALT Z = macros(ZoomOutAll?)


User Comments:

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.