Created
February 2, 2022 18:29
-
-
Save neto-developer/6314e3a4cbd663c27158fe0791b6a158 to your computer and use it in GitHub Desktop.
Show dimensions of all images on page
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
$('img').each(function(){ | |
let t = $(this); | |
let url = `https://dummyimage.com/${Math.round(t.outerWidth())}x${Math.round(t.outerHeight())}/f0f0f0/999`; | |
console.log(`${Math.round(t.outerWidth())}x${Math.round(t.outerHeight() => ${t.attr('src')}`); | |
t.attr('src', url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment