JQueryui对话框在页面中间显示白色框

时间:2013-04-04 15:23:29

标签: jquery user-interface dialog confirmation

我有一个css问题我相信在IE 10和FireFox 19.0.2中使用jquery UI对话框时出现在页面中间的白色矩形。希望有人能指出原因。 下面是我正在使用的页面代码和jquery,它是基本代码。

编辑:我发现只有当modal:true由于叠加而在对话框对象上设置时才会发生。

编辑:我解决了这个问题。将在8小时内更新答案。 UI CSS 1.10.2版修复了这个问题。 我猜我会升级。

JSFiddle测试这个,如果有人想看到http://jsfiddle.net/9dpsA/
要解决此问题,请将UI CSS的外部资源更改为1.10.2版本,而不是1.10.1。

<!DOCTYPE html>

  <html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
   <link href="../css/jquerycss/jquery-ui-1.10.1.custom.css" rel="stylesheet" />
    <script src="../JavaScript/jquery-1.9.1.min.js"></script>
    <script src="../JavaScript/jquery-ui-1.10.1.custom.min.js"></script>
    <script src="../JavaScript/jquery.blockUI.js"></script>
    <title>Site</title>

    <script>

        $(document).ready(function () {
            $('#dialog-confirm').hide();

            $("#btnArchive").click(function () {
                $('#dialog-confirm').dialog({
                    resizable: false,
                    height: "auto",
                    modal: true,
                    buttons: {
                        "Archive": function () {
                            $(this).dialog("close");
                        },
                        Cancel: function () {
                            $(this).dialog("close");
                        }
                    }
                });
            });



        });

       </script>
</head>
<body>
    <form id="form1" runat="server">

    <div id="page" style="text-align:center;">

        <div id="header">
            <h2>Site</h2>
            <asp:Button ID="btnMnu" runat="server" Text="Manage Tasks" PostBackUrl="someurl" />
            <input id="btnArchive" type="button" value="Archive Selected" />
            <asp:Button ID="btnDelete" runat="server" Text="Delete Selected" />
        </div>



        <div id="dialog-confirm" title="Archive the Selected Tasks?">
            <p>
                <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
                <span>Archiving will result in the deletion of the task. Are you sure you want to archive the task(s)?</span>
            </p>
        </div>

        <div id="footer">

        </div>
    </div>
    </form>
</body>
</html>

2 个答案:

答案 0 :(得分:1)

用这个替换你的CSS:

<link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" rel="stylesheet"/>

在这里看到演示

http://jsfiddle.net/9dpsA/1/

答案 1 :(得分:1)

UI CSS 1.10.2版修复了这个问题。我猜我会升级。

要解决此问题,请将UI CSS的外部资源更改为1.10.2版本,而不是1.10.1。