jQuery兑现预加载图片
jQuery实现预加载图片function($)?{????var?cache??[]??????//?Arguments?are?image?paths?relative?to?
jQuery实现预加载图片
function($)?{??- ??var?cache?=?[];??
- ????
- //?Arguments?are?image?paths?relative?to?the?current?page.??
- ??$.preLoadImages?=?function()?{??
- ????var?args_len?=?arguments.length;??
- ????for?(var?i?=?args_len;?i--;)?{??
- ??????var?cacheImage?=?document.createElement('img');??
- ??????cacheImage.src?=?arguments[i];??
- ??????cache.push(cacheImage);??
- ????}??
- ??}??
- jQuery.preLoadImages("image1.gif",?"/path/to/image2.png");?
- 转自:http://www.iteye.com/news/28047