Created
April 14, 2012 13:01
-
-
Save anonymous/2384288 to your computer and use it in GitHub Desktop.
HTML Image Load Events Test
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script> | |
$(window).load(function() { | |
console.log("Window Load: " + $("img").width() + "x" + $("img").height()); | |
}); | |
$(document).ready(function() { | |
console.log("Document Ready: " + $("img").width() + "x" + $("img").height()); | |
$("img").load(function() { | |
console.log("Image Load: " + $("img").width() + "x" + $("img").height()); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<p><img src="http://i.imgur.com/B0Li3.jpg" alt="Heidi"></p> | |
</body> | |
</html> | |
<!-- | |
Firefox 11.0: | |
Document Ready: 844x598 | |
Image Load: 844x598 | |
Window Load: 844x598 | |
Chromium 18.0.1025.142 (Ontwikkelaarsbuild 129054 Linux) Ubuntu 11.10: | |
Document Ready: 0x0 | |
Image Load: 844x598 | |
Window Load: 844x598 | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment