Last active
March 9, 2016 09:19
-
-
Save TyDraniu/2aeb9fa8e5b87ed6d068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) zoomImage(document.images[i], 2); | |
if (!L) alert("This page contains no images."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment