Firefox 上的 ThickBox 问题(溢出:隐藏不起作用)
我需要厚盒方面的帮助。 我在我的网站中使用它,但是溢出:隐藏的功能,在firefox中不起作用,仅在IE中起作用。 有人可以帮助我吗? 谢谢...
html和css没问题,我的问题是thickbox,因为它在IE 6或7中工作,但在mozilla(所有版本)中不行。 查看代码;
function tb_show(caption, url, imageGroup, leg, ttlTb) {//function called when the user clicks on a thickbox link
try {
if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
$("body","html").css({height: "100%", width: "100%"});
$("html").css("overflow","hidden"); <!-- JUST IN IE6 -->
if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
i need a help with thickbox.
I use it in my website, but a function of overflow:hidden, dont work in firefox, just in IE.
Someone can helpme?
thanks...
html and css no problem, my problem is thickbox, becausa it work in IE 6 or 7, but no in mozilla(all versions). look the code;
function tb_show(caption, url, imageGroup, leg, ttlTb) {//function called when the user clicks on a thickbox link
try {
if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
$("body","html").css({height: "100%", width: "100%"});
$("html").css("overflow","hidden"); <!-- JUST IN IE6 -->
if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,如果我们能够看到导致问题的 html/css 以及它如何不起作用的解释,这确实很有帮助。
其次,安装 firebug 扩展。 打开 firebug (F12) 并检查您关心的元素。 查看右侧的“样式”部分,了解实际应用的样式。
编辑:
不要在html上设置overflow:hidden,而是尝试在body上设置它......或者更好的是,在包含所有其他元素的div上设置它
First off, it really helps if we can see the html/css that's causing the problem as well as an explanation of how it's not working.
Secondly, install the firebug extension. open firebug (F12) and Inspect the element you're concerned about. Look at the Style section on the right to see what styles are actually being applied.
edit:
rather than set overflow: hidden on html, try setting that on body... or better yet, on a div containing all other elements