jquery 预加载图片
from:http://dreamerslab.com/blog/en/preload-images-with-jquery-preload-plugin/
需求
jQuery 1.2.3+
浏览器
Firefox 2.0+
- Internet Explorer 6+
- Safari 3+
- Opera 10.6+
- Chrome 8+
安裝
- 首先, 確定你使用了一個有效的 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,因为其实浏览器速度问题,所以效果不明显