列表项。我在中有多个列表项,但我只剩下2个以简化代码。
现在,我的问题是,在我单击另一个链接之前,切换和折叠工作正常。然后,如果我返回第一个,它将打开,但是当我尝试单击链接以将其折叠时,它将关闭它,然后重新打开它。
Bootstrap.css版本= 3.3.6
Bootstrap.js版本= 4.1.3
这是代码的一部分:
<ul class="ModuleTabButton" id="<%= ClientID & "_TabBtn"%>">
<li class="col-md-2 col-xs-0"></li>
<li a data-toggle="collapse" href="#Tool_Info <span>Info</span></a></li>
<li id="Tool_Info">
<script>
function <%= ClientID%>_TInfo() {
ABWeb.GestionWS.LoadMagInfo('',function(arg){ $('#<%= InfoDIV.ClientID%>').html(arg)},ShowError);}
</script>
</li>
<li class="col-md-2 col-xs-0"></li>
<li><a data-toggle="collapse"href="#Tool_Photos"><span>Banners</span></a></li>
<li id="Tool_Photos">
<AP:BAN ID="MagBan" runat="server" />
<script>
function <%= ClientID%>_TPhotos() {
GestionRefreshMagBan('<%= MagBan.ClientID%>', '');
}
</script>
</li>
</ul>
我真的希望这一点很清楚,以便您能够理解-___-
基本上,我单击“信息”,显示和隐藏效果很好。然后,如果您单击横幅,它仍然可以很好地用于横幅,但是如果您返回并单击“信息”,它将显示但不会隐藏,只要您再次单击它(它会尝试,但会以某种方式重新打开一半)。
这是我的bundleconfig文件
Public Class BundleConfig
' For more information on Bundling, visit http://go.microsoft.com/fwlink/? LinkID=303951
Public Shared Sub RegisterBundles(ByVal bundles As BundleCollection)
Dim JQVer As String = "3.3.1"
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", New ScriptResourceDefinition() With {
.Path = "~/Scripts/jquery-" + JQVer + ".min.js",
.DebugPath = "~/Scripts/jquery-" + JQVer + ".js",
.LoadSuccessExpression = "window.jQuery"})
Dim JQUIVer As String = "1.12.1"
ScriptManager.ScriptResourceMapping.AddDefinition("jquery.ui.combined", New ScriptResourceDefinition() With {
.Path = "~/Scripts/jquery-ui-" + JQUIVer + ".min.js",
.DebugPath = "~/Scripts/jquery-ui-" + JQUIVer + ".js"})
bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/WebUIValidation.js",
"~/Scripts/WebForms/MenuStandards.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/GridView.js",
"~/Scripts/WebForms/DetailsView.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/WebParts.js"))
' Order is very important for these files to work, they have explicit dependencies
bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"))
bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Mag/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Mag/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Mag/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Mag/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"))
bundles.Add(New ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"))
bundles.Add(New ScriptBundle("~/Mag/bundles/modernizr").Include(
"~/Scripts/modernizr-*"))
ScriptManager.ScriptResourceMapping.AddDefinition("ckeditor", New ScriptResourceDefinition() With {
.Path = "~/Scripts/ckeditor.js",
.DebugPath = "~/Scripts/ckeditor/ckeditor.js"})
ScriptManager.ScriptResourceMapping.AddDefinition("respond", New ScriptResourceDefinition() With {
.Path = "~/Scripts/respond.min.js",
.DebugPath = "~/Scripts/respond.js"})
ScriptManager.ScriptResourceMapping.AddDefinition("jQuery.FileUpload", New ScriptResourceDefinition() With {
.Path = "~/Scripts/jQuery.FileUpload/jquery.fileupload.js",
.DebugPath = "~/Scripts/jQuery.FileUpload/jquery.fileupload.js"})
End Sub
End Class
这是我Site.Master的一部分:
<head>
<%--<link rel="stylesheet" type="text/css" href="~/api/Public/SiteCSS APPVER=1&TESTVER=1" />--%>
<%--<webopt:bundlereference runat="server" path="~/Content/css" />--%>
<link rel="stylesheet" type="text/css" href="~/Content/Slick/slick.css?ver=1.01" />
<link rel="stylesheet" type="text/css" href="~/Content/Slick/slick-theme.css" />
<link rel="stylesheet" type="text/css" href="~/Content/Themes/jquery-ui/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="~/Content/Themes/jquery-ui/jquery-ui.theme.css" />
<link rel="stylesheet" type="text/css" href="~/Content/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="~/Content/DynamicView.css" />
<link rel="stylesheet" type="text/css" href="~/Content/Site.css?ver=1.2" />
<link rel="stylesheet" type="text/css" href="~/css/all.min.css?ver=5.5" />
<link rel="stylesheet" type="text/css" href="~/css/font-awesome-animation.min.css" />
<link rel="stylesheet" type="text/css" href="~/Scripts/cropper/cropper.min.css" />
<link href="~/Content/Images/ABWeb.ico" rel="shortcut icon" type="image/x-icon" />
</head>
<body>
<form runat="server">
<asp:ScriptManager runat="server" ID="MasterScript">
<Scripts>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="jQuery.FileUpload" />
<asp:ScriptReference Name="ckeditor" />
<asp:ScriptReference Name="bootstrap" />
<asp:ScriptReference Name="respond" />
<asp:ScriptReference Name="WebFormsBundle" />
<asp:ScriptReference Path="~/Scripts/Slick/Slick.js?V1.8" />
<asp:ScriptReference Path="~/Scripts/cropper/cropper.min.js?V1.01" />
<asp:ScriptReference Path="~/Scripts/jquery.lazyload.min.js?V1.8.4" />
<asp:ScriptReference Path="~/Scripts/Helper.js?V1.01" />
<asp:ScriptReference Path="~/Scripts/ABWeb.js?V1.07" />
<asp:ScriptReference Path="~/Scripts/jquery.myutil.js?V1.8" />
</Scripts>
<Services>
<asp:ServiceReference path="~/App_Dynamic/Master.asmx" />
<asp:ServiceReference path="~/App_Dynamic/Public.asmx" />
</Services>
</asp:ScriptManager>