【发布时间】:2011-05-30 22:49:39
【问题描述】:
在 Firefox 中,如果用户在页面加载之前单击下面的链接,它将在新窗口中打开,而不是在厚框对话框中打开。有什么办法可以防止这种情况发生?
我无法在 IE/safari 上实现这一点
Thickbox 通过在链接上设置类“thickbox”来工作:
<a href="http://someurl.com" class="thickbox none new" title="Open">Open</a>
然后在thickbox中
//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;
});
【问题讨论】:
-
你能贴一些代码给我们看看吗?
-
需要注意的是,Thickbox 已经正式停止生命支持一年半了......可能是时候寻找替代插件了。