Last active
August 29, 2015 14:10
-
-
Save KruegerDesigns/8cdbba88f0deeec4736f to your computer and use it in GitHub Desktop.
See which images were resized. Great for CMS sites where the client uses a full resolution image.
This file contains 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
window.onload = function() { | |
// All images on page as an array | |
var image = document.images; | |
// Loop trough each image and return its height/width values | |
for (var i = image.length - 1; i >= 0; i--) { | |
image[i].style.outline = "3px solid orange"; | |
image[i].scrollIntoView(); | |
alert("Image height: " + image[i].height + "px \n" + "Image width: " + image[i].width + "px \n" + "Original height: " + image[i].naturalHeight + "px \n" + "Original width: " + image[i].naturalWidth + "px \n"); | |
image[i].style.outline = "0px none"; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment