Chrome/Safari 中的 JQuery Thickbox Ajax 加载器错误
我知道这是一个旧的 JQuery 库,但我仍在整个站点中使用 Thickbox 3.1。在 Chrome 和 Safari 上,当您单击厚盒链接时,会弹出 iframe 页面,但没有预加载器图像。它直接进入页面并等待弹出窗口直到加载。当弹出窗口加载大量内容并且花费超过几秒钟的时间时,这就会成为一个问题。对于用户来说它似乎被破坏了。应该发生什么,就像在 IE 和 Firefox 上一样,有一个正在加载的 ajax 图像,它会旋转并等待弹出窗口加载,直到它消失。有其他人遇到过这个问题并且知道如何修复这个问题的 JS 代码吗?我相信这是在 Thickbox.js 文件中调用它的地方:
//on page load call tb_init
$(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
});
感谢任何人的帮助。这让我疯狂地想弄清楚!
I know it's an old JQuery library, but I am still using Thickbox 3.1 throughout my site. On Chrome and Safari, when you click a thickbox link, the iframed page pops up, but there is no preloader image. It goes directly to the page and waits on the popup until it loads. This becomes a problem when the popup is loading a lot of content and takes more than a few seconds. It seems broken to the user. What should happen, like it does on IE and Firefox, is there is a loading ajax image, that spins and waits for the popup to load until it disappears. Has anyone else had a problem with this and know how to fix the JS code for this? I believe this is where it is calling it in the thickbox.js file:
//on page load call tb_init
$(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
});
Thanks anyone for the help. This is driving me crazy trying to figure out!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于想通了。看起来 Thickbox 3.1 的创建者添加了代码来禁用 Safari/Chrome 上的加载功能。也许在2007年,它还不受支持。解决方案在于注释掉第 237 至 240 行。
I finally figured it out. It seems like the creator of Thickbox 3.1 added code to disable the loading functionality on Safari/Chrome. Maybe in 2007, it wasn't supported. The solution lies in commenting out lines 237 to 240.