jquery - Hidden Modal showing when $(document).ready alert called -
i have form contains modal pop hidden until button clicked.
when page loads, want display alert user, , i'm trying using jquery
but when alert shown, modal popup visible, after click ok on alert, modal popup hides again. there improve way this, have advice?
here code : thanks
class="snippet-code-html lang-html prettyprint-override"><asp:content id="content1" contentplaceholderid="headcontent" runat="server"> <style type="text/css"> .modalbackground { background-color: gray; z-index: 10000; filter: alpha(opacity=80); opacity: 0.8; } .hiddenelement { display: none; } .modalcontainer { position: absolute; display: table; background-color: white; border: 1px solid gray; } </style> <script language="javascript" type="text/javascript"> $(document).ready(function() { alert('logged in'); }); </script> </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <asp:updatepanel id="up" runat="server"> <contenttemplate> <asp:button id="btnclick" runat="server" text="click me" onclick="btnclick_click" /> </contenttemplate> </asp:updatepanel> <asp:hiddenfield id="hiddenmodalmore" runat="server" /> <asp:modalpopupextender id="moremodal" targetcontrolid="hiddenmodalmore" runat="server" dropshadow="false" popupcontrolid="pnlmoreinfo" backgroundcssclass="modalbackground" /> <asp:panel id="pnlmoreinfo" runat="server" cssclass="hiddenelement modalcontainer"> <asp:updatepanel id="up_more" runat="server" updatemode="conditional"> <contenttemplate> <table> <tr align="center"> <td colspan="2"> test </td> </tr> <tr align="center"> <td colspan="2" align="center"> <asp:button id="btnsave_moreinfo" runat="server" text="save" onclick="btnsave_moreinfo_click" /> <asp:button id="btncancel_moreinfo" runat="server" text="cancel" onclick="btncancel_moreinfo_click" /> </td> </tr> </table> </contenttemplate> </asp:updatepanel> </asp:panel> </asp:content>
set initial style on modal dialog display:none in css or element create it. if yiu depend in domready hide elements, have potential flash in view @ start of dorm ready , before window loaded.
jquery .net
No comments:
Post a Comment