试图找到一个 jQuery 图像预加载器
我正在尝试找到一个与 Marcofolio 幻灯片配合良好的 jQuery 图像预加载器(此处 http:// /www.marcofolio.net/webdesign/advanced_jquery_background_image_slideshow.html)。
费城网站上也使用了相同的幻灯片:http://www.visitphilly.com/ -但是当我使用我的网络开发工具查看工作中的 javascript 时,我很难弄清楚预加载器被调用的确切位置。
我还尝试使用以下预加载代码,但它似乎对这种情况没有帮助(似乎在 Safari 浏览器中加载速度最慢):
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
});
}
preload([
'images/image1.jpg',
'images/image2.jpg',
'images/image3.jpg',
'images/image4.jpg',
]);
如果聪明的人可以检查访问费城网站元素,他们可能能够看到我正在做什么所以显然这里失踪了。或者,预加载插件建议将不胜感激,因为我已经尝试了一些似乎对这个特定幻灯片没有帮助的插件。
谢谢你!
I am trying to find a working jQuery image preloader that plays well with the Marcofolio slideshow (here http://www.marcofolio.net/webdesign/advanced_jquery_background_image_slideshow.html).
The same slideshow is being used on the Philadelphia website here: http://www.visitphilly.com/ - but when I use my web developer tools to view the javascript at work I'm having a hard time trying to figure out exactly where the preloader is being a called.
I also tried using the following preload code, but it doesn't seem to help the situation (seems to load most slowly in the Safari browser):
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
});
}
preload([
'images/image1.jpg',
'images/image2.jpg',
'images/image3.jpg',
'images/image4.jpg',
]);
If someone smart could inspect the visitphilly site element they may be able to see what I'm so obviously missing here. Alternatively, a preloading plugin suggestion would be appreciated, as I've tried a few which don't seem to help this particular slideshow.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你不需要 jQuery:
You don't need jQuery for that:
尝试以正确的顺序预加载图像。
您还可以指定图像大小(“新图像(宽度,高度)”),但我不确定它是否有帮助。
Try to preload images in right order.
You can also specify image size ('new Image(width, height)') but I'm not sure if it can help.
我一直使用这个很棒的插件: http://flesler.blogspot.com/2008/ 01/jquerypreload.html
除了编码良好之外,该插件处理的 ie 中预加载图像还存在问题。
I've always used this fantastic plugin : http://flesler.blogspot.com/2008/01/jquerypreload.html
Besides the fact that it is well coded - there are issues with preloading images in ie that this plugin deals with.