Итак, я занимаюсь разработкой веб-сайта vb.net и использую «свернуть», чтобы переключать некоторые части страницы.Я пытаюсь использовать ссылку внутри элемента списка для переключения (через href) другого элемента списка .У меня есть несколько элементов списка, подобных этому, внутри
Теперь моя проблема в том, что переключение и свертывание работают нормально, пока я не нажму на другую ссылку.Затем, если я вернусь к первому, он откроется, но когда я попытаюсь щелкнуть ссылку, чтобы свернуть ее, он закроет ее, но затем снова откроет.
Bootstrap.css версия = 3.3.6Bootstrap.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>
Я действительно надеюсь, что это достаточно ясно, чтобы вы могли понять -___- В основном, когда вы нажимаете на Info, шоу и скрытие работают нормально.Затем, если вы нажмете на Баннеры, он все равно будет работать хорошо для Баннеров, но если вы вернетесь назад и нажмете на Инфо, он будет отображаться, но не будет скрываться, если вы повторно щелкнете по нему (он попытается, но каким-то образом снова откроется на полпути).
Вот мой файл конфигурации пакета
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
И вот часть моего сайта. Мастер:
<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>