【问题标题】:ThickBox Problem on firefox (overflow:hidden no work)Firefox上的ThickBox问题(溢出:隐藏无效)
【发布时间】:2009-06-19 12:53:57
【问题描述】:

我需要有关厚盒的帮助。 我在我的网站中使用它,但是一个溢出功能:隐藏,不在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);
            }

【问题讨论】:

    标签: javascript firefox overflow thickbox


    【解决方案1】:

    首先,如果我们能看到导致问题的 html/css 并解释它如何它不起作用,这真的很有帮助。

    其次,安装firebug 扩展。打开 firebug (F12) 并检查您关注的元素。查看右侧的样式部分,了解实际应用了哪些样式。

    编辑

    而不是设置溢出:隐藏在 html 上,尝试将其设置在 body... 或者更好的是,在包含所有其他元素的 div 上

    【讨论】:

    • 您甚至可以使用 firebug 实时更改样式以找出需要更改的内容才能使您的代码正常工作。
    猜你喜欢
    • 1970-01-01
    • 2018-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-09
    • 1970-01-01
    • 2011-10-22
    相关资源
    最近更新 更多