Skip to content

Instantly share code, notes, and snippets.

@wangwen1220
Last active January 2, 2016 10:59
Show Gist options
  • Save wangwen1220/8293948 to your computer and use it in GitHub Desktop.
Save wangwen1220/8293948 to your computer and use it in GitHub Desktop.
JS: jQuery 实现的 Facebook 风格的图片预加载效果 | img preload facebook
// 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