简体   繁体   English

jQuery对话框IE6和IE7挂起

[英]Jquery dialog IE6 and IE7 hangs

I'm using jquery to show a dialog box, but its causing IE6 and IE7 to hang. 我正在使用jquery显示一个对话框,但是它导致IE6和IE7挂起。 Suggestions anybody? 建议有人吗? Thanks 谢谢

  $(""#" + this.pnlConfirmPanel.ClientID + @""").dialog(
                        {
                           autoOpen: false,
                            modal:true,
                             resizable: false,
                            draggable: false
                        })       

The line which causes it to hang is: 导致其挂起的行是:

modal:true

Update 1 Sorry must have clarified its a asp.net page, the resulting code looks like this: 更新1对不起,必须已经阐明了其asp.net页,生成的代码如下所示:

$("#ctl00_ContentPlaceHolder1_JobAdmin1_pnlConfirmPanel").dialog(
                        {
                           autoOpen: false,
                            modal:true,
                             resizable: false,
                            draggable: false
                        }) 

If I remove modal:true, the dialog box shows and closes fine in both IE6 and IE7. 如果我删除modal:true,则该对话框在IE6和IE7中均显示并正常关闭。 Its when I add the modal:true line, that causes the browser to crash... 当我添加modal:true行时,它会导致浏览器崩溃...

Update 2 更新2
Thought I'd post the rest of the javascript and html, just in case somebody would like to try it out. 以为我会发布其余的javascript和html,以防万一有人想尝试一下。 (To simplify I shorted the long identifier I had for the panel above) (为简化起见,我在上面的面板中缩短了我的长标识符)

<script src="JavaScript/jquery-1.5.2.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">

    $().ready(function () {
        $("#ConfirmPanel").dialog(
                        {
                            autoOpen: false,
                            width: 400,
                            height: 300,
                            modal: true
                        });

        $('#Button1').click(function () {
            $("#ConfirmPanel").dialog('open');
            return false;
        });
    });



</script>

<span id="lblClicked"></span>
<input type="submit" name="Button1" value="Test" id="Button1" />
<div id="ConfirmPanel" style="width: 400px; height: 200px;">
<input type="submit" name="btnClose" value="" id="btnClose" />
    <h2>
        Hello</h2>
</div>
</form>

I had this problem as well. 我也有这个问题。 By simply changing the position attribute from fixed to absolute on the "ui-widget-overlay" class, I resolved the problem. 通过简单地将“ ui-widget-overlay”类上的position属性从固定更改为绝对,我解决了这个问题。

I made a JS Fiddle of it: 我做了一个JS小提琴:

http://jsfiddle.net/sh9qM/ http://jsfiddle.net/sh9qM/

Does it work in other browsers? 是否可以在其他浏览器中使用?

Have you tried earlier versions of the jQuery libraries? 您是否尝试过jQuery库的早期版本?

EDIT: Since you have indicated that moving to an earlier version of jQuery solved the problem, perhaps you could enter it as a bug at the jQuery web site. 编辑:由于您已经表示转移到早期版本的jQuery已解决了该问题,因此也许您可以在jQuery网站上将其作为错误输入。

我和我的同事今天遇到了这个问题-我们的解决方案是将jQuery UI CSS文件更新为最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM