- jQuery.preloadImages = function() {
- for(var i = 0; i < arguments.length; i++) {
- $("<img />").attr('src', arguments[i]);
- }
- };
- //用法
- $.preloadImages('image1.gif', '/path/to/image2.png', 'some/image3.jpg');
- //该片段来自于http://www.codesnippet.cn/detail/281220121236.html
来源: http://www.codesnippet.cn/detail/281220121236.html