`

jquery 预加载图片

阅读更多

from:http://dreamerslab.com/blog/en/preload-images-with-jquery-preload-plugin/   

需求

jQuery 1.2.3+


 

浏览器

     Firefox 2.0+


 

安裝

  • 首先, 確定你使用了一個有效的 DOCTYPE
  • 引用 JS 檔案

 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="path-to-file/jquery.preload.js"></script>

 

page

  

$.preload( '/img/space.gif',
  '/img/loading.gif',
  '/img/header-bg.png',
  '/img/avatar.jpg'
);

 

OK了,详细查看附件。其实关键还是IE,因为其实浏览器速度问题,所以效果不明显

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics