ITeye博客

jquery 预加载图片

chen_miao · 2012-04-24 14:39 · jquery · js · Web前端 · jQuery · JS · jquery preload · preload · Markdown

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,因为其实浏览器速度问题,所以效果不明显

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。