jquery - jqModal 对话框始终处于叠加状态

标签 jquery jqmodal

我有以下代码,但我束手无策,因为对话框总是出现在覆盖层下。任何建议将不胜感激:

<head runat="server">
    <title></title>
    <link href="../Styles/jqModal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #shift-edit-popup
        {
            display: none;
        }
    </style>
    <script src="../Scripts/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="../Scripts/jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#shift-edit-popup").jqm({
                toTop: true
            }).jqmAddTrigger("#show-button");
        });
    </script>
</head>
<body>
    <form id="form" runat="server">
    <input id="show-button" type="button" value="Show" />
    <div id="shift-edit-popup">
        <div>
            <asp:Label ID="resourceLabel" runat="server" AssociatedControlID="resourceList">Resource:</asp:Label>
            <asp:DropDownList ID="resourceList" runat="server" DataTextField="Name" DataValueField="ResourceId" Width="120px">
            </asp:DropDownList>
        </div>
    </div>
</body>

最佳答案

根据我所看到和尝试,您需要在对话框 div 上使用包含的 jqmWindow 类并删除此:

<style type="text/css">
    #shift-edit-popup
    {
        display: none;
    }
</style>

您的代码应如下所示:

<head runat="server">
    <title></title>
    <link href="Scripts/jqModal.css" rel="stylesheet" type="text/css" />

    <script src="Scripts/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="Scripts/jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#shift-edit-popup").jqm({
                toTop: true,
                modal: true
            }).jqmAddTrigger("#show-button");
        });
    </script>
</head>
<body>
    <form id="form" runat="server">
    <input id="show-button" type="button" value="Show" />
    <div id="shift-edit-popup" class="jqmWindow">
        <div>
            Resource:
            <select><option value="1">One</option><option value="2">Two</option></select>
        </div>
    </div>
</body>

(您只需相应地更改脚本和CSS引用)

关于jquery - jqModal 对话框始终处于叠加状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2745022/

相关文章:

javascript - 如何在 jQuery 中通过数组中的索引访问键的值?

javascript - jQuery,在更改时运行函数

javascript - 无法将 jQuery jqModal 分配给动态添加的链接

jquery - asp.NET (4.0) 与 jqModal - 在 IE8 中,服务器端按钮提交存在问题

jquery - 在 jqgrid 中,是否有自动计算 editGridRow() 弹出窗口的宽度

javascript - $() 函数未按预期工作

jquery - 将谷歌地图标记集中在厚盒中

ajax - 在加载数据之前显示 Ajax 加载器

javascript - 我如何提交我的 jquery 模态表单

javascript - JQGRID-JQMODAL : Disable close modal when click on overlay