Last active
January 2, 2016 10:59
-
-
Save wangwen1220/8293948 to your computer and use it in GitHub Desktop.
JS: jQuery 实现的 Facebook 风格的图片预加载效果 | img preload facebook
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
// jQuery 实现的 Facebook 风格的图片预加载效果 | |
var preloadimg = "preload.jpg"; | |
$(function() { | |
window.setTimeout(function() { | |
var img = $("<img>").attr("src", preloadimg).load(function() { | |
$('div').append(img); | |
}); | |
}, 100); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment