开发者

JQuery Thickbox Ajax Loader Bug in Chrome/Safari

开发者 https://www.devze.com 2023-01-05 20:07 出处:网络
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 imag

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 f开发者_如何学编程or 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!


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.

if($.browser.safari){
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}
0

精彩评论

暂无评论...
验证码 换一张
取 消