Created
September 16, 2014 02:30
-
-
Save shenqihui/330a54b4ef6c8cd762ae to your computer and use it in GitHub Desktop.
img load
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
var img = document.createElement('img'); | |
img.onload = function() { | |
var height = this.height; | |
var width = this.width; | |
var src = this.src; | |
console.log(this, src, width, height); | |
} | |
document.body.appendChild(img); | |
img.src = "http://ww2.sinaimg.cn/bmiddle/86d107cfjw1ekd9ylb8hkg20b40b4e83.gif"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment