Jquery UI对话框,也是灰色的

前端之家收集整理的这篇文章主要介绍了Jquery UI对话框,也是灰色的前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用jquery UI对话框来修改ASP.NET网站中的数据行。打开对话框时,将对话框添加到底层表单中,这样可以使用回发。 $(‘#’id).parent()。appendTo($(“form”));

但是当我设置对话框属性模态:true不只是背景是灰色的,对话框也是灰色和不可访问的。

如果我删除$(‘#’id).parent()。appendTo($(“form”));它的工作原理应该是,但是我不能使用回发。

我做错了什么,或者我想念一个这样的工作吗?

Javascript在.aspx的顶部

@H_404_10@<script type="text/javascript"> $(document).ready(function () { $('#workDialog').dialog({ autoOpen: false,draggable: true,resizable: false,width: 800,height: "auto",modal: true }); }); function showDialog(id) { $('#' + id).parent().appendTo($("form")); $('#' + id).dialog("open"); } function closeModalDiv(id) { $('#' + id).dialog("close"); } </script>

div包含对话框

@H_404_10@<div id="workDialog" title="Basic dialog"> <asp:UpdatePanel ID="upWorkDialog" runat="server" UpdateMode="Conditional"> <ContentTemplate> <table id="Table1" class="item"> <tr> ... </tr> <tr> <td><asp:TextBox ID="txt...></asp:TextBox></td> <td><asp:TextBox ID="txt...></asp:TextBox></td> <td><asp:TextBox ID="txt...></asp:TextBox></td> <td><asp:TextBox ID="txt...></asp:TextBox></td> </tr> </table> <asp:Label ID="lblWorkEditError" runat="server" Text=""></asp:Label> <asp:Button ID="btnSave" runat="server" Text="Gem" OnClick="btnSave_Click" /> <asp:Button ID="btnCancel" runat="server" Text="Annuller" OnClientClick="javascript:closeModalDiv('workDialog');" /> </ContentTemplate></asp:UpdatePanel> </div>

解决方法

这是1.10.0中的已知错误,在旧版本中可以正常工作,但是我通过更改ui对话框样式的z-index来解决

在样式表或页面添加以下样式

@H_404_10@.ui-dialog { z-index: 101; }

或者在jquery-ui-1.10.0 css中找到.ui-dialog类,并添加“z-index:101;”风格规则

现在重新加载页面和IT工作…

猜你在找的jQuery相关文章