本文介绍了我怎么能再打开我的div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! i有一个ui问题: i在我的管理页面中创建一些表单然后我隐藏所有的css(display:none;) i使用jquery淡出它们。 问题是:当我点击提交时(在页面中的一个表单中) 页面是a刷新和我的opend(使用中)表格将会关闭。 我怎么能打开它(最后一个表格)? i这样做对于我的所有表格: 这是一个表格图标(当我点击此图标时,我的隐藏表格将会打开): < li style = margin-top:9px; margin-right:20px; z-index:100000000; > < img src = pic /hotel-icon.png\" id = mng title = اضافهکردنوحذفکردنشهر alt = اضافهکردنوحذفکردنشهر width = 32px height = 32px / > < / li > 这是应该打开的菜单之一: < div class = col-lg-12 id = mnga style = margin-left:auto; margin-right:auto; display:none; direction:rtl; > <! - منویاضافهکردنشهر - > < div class = panel panel-primary > < div class = panel-heading > اضافهکردنشهر< / div > < div class = panel-body > < ; asp:标签 ID = Label5 runat = server 文本 = نام شهر: > < / asp:Label > & nbsp;& nbsp ;& nbsp;& nbsp;& nbsp; < asp:TextBox ID = TextBox4 runat = server > < / asp:TextBox > < br / > < br / > < asp:标签 ID = Label6 runat = server 文本 = مخففشهر: > < / asp:标签 > & nbsp; < asp:TextBox ID = TextBox5 runat = 服务器 > < / asp :TextBox > & nbsp; < asp:按钮 ID = Button15 runat = server 文本 = ثبت OnClick = Button15_Click / > & nbsp;& nbsp;& nbsp; < asp:标签 ID = Label28 runat = server ForeColor = #CC3300 > < / a sp:标签 > < / div > < / div > < div class = panel panel-primary > < div class = panel-heading > حذفشهر< / div > < div class = panel-body > < asp:DropDownList ID = DropDownList1 runat = server > < / asp:DropDownList > & nbsp; < asp:按钮 ID = Button3 runat = server 文本 = حذف OnClick = Button3_Click / > & nbsp;& nbsp;& nbsp; < asp:标签 ID = Label29 runat = server ForeColor = #CC3300 > < / asp:标签 > < / div > < / div > <! - پایانمنویاضافهکرد شهر - > < / div > 我用这个代码打开菜单(所有其他菜单将关闭,我的选择菜单将打开): var r = 0 ; $( document )。ready( function (){ $(' #mng')。click( function (){ r ++; if (r% 2 == 0 ){ $( #prfa).hide( 500 ); $( #mnga)。hide( 500 ); $( #cmnta)。hide( 500 ); $( #posta)。hide( 500 ) ; $( #htla)。hide( 500 ); $( #imga)。hide( 500 ); $( #faclta)。hide( 500 ); $( #rooma)。hide( 500 ); $( #roomadda)。hide( 500 ); $( #facilitya)。hide( 500 ); } else { $( #prfa)。hide( 500 ); $( #cmnta)。hide( 500 ); $( #posta)。hide( 500 ); $( #htla)。hide( 500 ); $( #faclta)。hide( 500 ); $( #imga)。hide( 500 ); $( #rooma)。hide( 500 ); $( #roomadda)。hide( 500 ); $( #facilitya)。hide( 500 ); $( #mnga)。fadeIn( 500 ); } }); }); 我尝试过: 但是当我点击提交时我的页面会做刷新功能,这个表格(我选择的)关闭,我无法看到表格中的操作结果。解决方案 ( document )。ready( function (){ (' #mng')。click( function (){ r ++; if (r% 2 == 0 ){ ( #prfa)。hide( 500 ); hi,i have one ui problem :i create some form in my admin page and i hide all of then in css(display:none;)i fadeIn them with jquery.the problem is : when i click on a submit(in one of the form in the page)the page be a refresh and my opend(in use) form will be close.how can i open it(last opend form)?i do this for all my form :this is one form icon (when i click on this icon my hidened form will be open) :<li style="margin-top: 9px; margin-right: 20px;z-index:100000000;"><img src="pic/hotel-icon.png" id="mng" title="اضافه کردن و حذف کردن شهر" alt="اضافه کردن و حذف کردن شهر" width="32px" height="32px" /></li>this is one of the menu which should be open :<div class="col-lg-12" id="mnga" style="margin-left: auto; margin-right: auto; display:none ;direction:rtl;"> <!--منوی اضافه کردن شهر--> <div class="panel panel-primary"> <div class="panel-heading">اضافه کردن شهر</div> <div class="panel-body"> <asp:Label ID="Label5" runat="server" Text="نام شهر :"></asp:Label> <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox><br /><br /><asp:Label ID="Label6" runat="server" Text="مخفف شهر :"></asp:Label> <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox> <asp:Button ID="Button15" runat="server" Text="ثبت" OnClick="Button15_Click" /> <asp:Label ID="Label28" runat="server" ForeColor="#CC3300"></asp:Label></div> </div> <div class="panel panel-primary"> <div class="panel-heading">حذف شهر</div> <div class="panel-body"><asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList> <asp:Button ID="Button3" runat="server" Text="حذف" OnClick="Button3_Click" /> <asp:Label ID="Label29" runat="server" ForeColor="#CC3300"></asp:Label></div> </div> <!--پایان منوی اضافه کردن شهر--> </div>and i open the menu with this code(all other menu will be close and my choice menu will be open) :var r = 0;$(document).ready(function () { $('#mng').click(function () { r++; if (r % 2 == 0) { $("#prfa").hide(500); $("#mnga").hide(500); $("#cmnta").hide(500); $("#posta").hide(500); $("#htla").hide(500); $("#imga").hide(500); $("#faclta").hide(500); $("#rooma").hide(500); $("#roomadda").hide(500); $("#facilitya").hide(500); } else { $("#prfa").hide(500); $("#cmnta").hide(500); $("#posta").hide(500); $("#htla").hide(500); $("#faclta").hide(500); $("#imga").hide(500); $("#rooma").hide(500); $("#roomadda").hide(500); $("#facilitya").hide(500); $("#mnga").fadeIn(500); } });});What I have tried:but when i click on submit my page will do refresh function and this form (which i choiced) close and i cant see the result of operation in the form. 解决方案 (document).ready(function () {('#mng').click(function () { r++; if (r % 2 == 0) {("#prfa").hide(500); 这篇关于我怎么能再打开我的div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-04 22:14