jquery - IE6中奇怪的布局问题

标签 jquery internet-explorer-6 overlay jquery-tools

alt text

网址:http://www.hkpete.com/test.html

jQuery 1.42
jQuery 工具 1.2.3 覆盖

IE7也有这个问题(在ietester上测试)

我找不到问题所在。

非常感谢。

<div id="dialog-content">
    <!--Login -->
    <div id="login" class="panel" style="display:none">
    Login..................
    </div>
    <!--Register -->
    <div id="register" class="panel" style="display:none">
    Register..................
    </div>
</div>

<!--Links-->
<a href="javascript:;" onclick="showDialog('#login','member');">Login</a>
<a href="javascript:;" onclick="showDialog('#register','member');">Register</a>

<script type="text/javascript">
var ol;
var dialog=null;
function showDialog(panel,action){
      var each=each ? each : 0;
     function overlay(){
            if(panel){
                $("#dialog div.panel").hide();
                //show panel login,register,lostpw
                $(panel).show();
            }
            if(ol !== undefined && ol.isOpened()) {

                    $("#dialog").css("top", ( $(window).height() - $("#dialog").height() ) / 2+$(window).scrollTop() + "px"); 
                    $("#dialog").css("left", ( $(window).width() - $("#dialog").width() ) / 2+$(window).scrollLeft() + "px");
            }

            //Overlay load          
            ol=$("#dialog").overlay({top:'center', left:'center', closeOnClick:false, api:true }).load();

            $("#dialog .close").click(function(){
               ol.close();
            }); 
     }


    overlay();
    //cur action
    dialog=action;

return false;
}
</script>

最佳答案

我想我知道这个错误是什么:http://www.positioniseverything.net/explorer/ienondisappearcontentbugPIE/index.htm .

列出的解决方法是:

Work arounds One may 'release the spell' in a number of ways:

  1. temporarily switch the content's display property to 'block' and back to 'none'.
  2. temporarily switch the content's position property from 'relative' to 'absolute' and back, or vice versa.
  3. temporarily switch the content's visibility property to 'hidden' and back. (But this only works if the content is positioned absolutely! The wonderful world of IE...)

去那里看看以获取更多信息。

关于jquery - IE6中奇怪的布局问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3689725/

相关文章:

javascript - 将多个按键绑定(bind)到按键事件

javascript - 为什么非动态创建的 iframe 填充程序会显示,而动态创建的 iframe 填充程序则不会显示?

javascript - 在 FireFox 中有效但在 IE 6 中无效的 Ajax 函数

objective-c - Mac 中的叠加窗口

javascript - 修改PHP使用JS/JQuery与MySQL通信

javascript - jquery onchange 不触发

关闭浏览器后 jQuery 1.8.3 xsrf 错误

html - 如何为 li 文本和带有图像的 li 文本做有效的 CSS?

java - 创建 Artifact 叠加

javascript 文本覆盖