jQuery技巧攻略

来源:互联网 发布:淘宝不能货到付款 编辑:程序博客网 时间:2024/05/29 13:20

此段代码帮助用户快速加载图片或网页页面。

<font><font>jQuery.preloadImagesInWebPage = function() {     for(var ctr = 0; ctr<arguments.length; ctr++){jQuery("").attr("src", arguments[ctr]);}}To use the above method, you can use the following piece of code:$.preloadImages("image1.gif", "image2.gif", "image3.gif");To check whether an image has been loaded, you can use the following piece of code:$('#imageObject').attr('src', 'image1.gif').load(function() {alert('The image has been loaded…');});</font></font>
0 0
原创粉丝点击