我在VS2015,JQuery 2.2.4和Bootstrap 3.3.7中工作,遇到Bootstrap标签组件问题,因为当我点击它们时我的下拉菜单没有显示。我总共有5个标签,其中一些标签是标题和标题处的下拉对象。页脚工作正常,但如果单击其他选项卡,则它们将停止工作
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<environment names="Development">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="~/css/site.css" />
<link rel="stylesheet" href="~/css/header.css" />
<link href="~/css/Video.css" rel="stylesheet" />
<link href="//vjs.zencdn.net/6.2.0/video-js.min.css" rel="stylesheet"/>
<link rel="shortcut icon" href="~/images/favicon_azul-gris32px.png" />
</environment>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="~/lib/bootstrap-treeview/src/js/bootstrap-treeview.js"></script>
<script src="//vjs.zencdn.net/6.2.0/video.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.8.0/videojs-contrib-hls.min.js"></script>
<script src="~/js/site.js"></script>
DROPDOWN:
<li class="dropdown">
<a id="username_dropdown" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
@UserManager.GetUserAsync(User).Result.Name
<span class="caret"></span>
</a>
<ul class="dropdown-menu" id="dropdown-account">
<li id="menu-li-group">
<a asp-area="" asp-controller="Groups" asp-action="Index">
<img id="img-li-group" class="menu-icons-account" src="~/images/home-usermenu/UM_groups_inactive.png" />
@Localizer["Groups"]
</a>
</li>
<li id="menu-li-users">
<a asp-controller="ApplicationUsers" asp-action="Index">
<img id="img-li-users" class="menu-icons-account" src="~/images/home-usermenu/UM_users_inactive.png" />
@Localizer["Users"]
</a>
</li>
<li id="menu-li-log">
<a asp-area="" asp-controller="LogAdminTasks" asp-action="Index">
<img id="img-li-log" class="menu-icons-account" src="~/images/home-usermenu/UM_log_inactive.png" />
@Localizer["Activity Log"]
</a>
</li>
<li id="menu-li-profile">
<a asp-area="" asp-controller="Manage" asp-action="ChangePassword">
<img id="img-li-profile" class="menu-icons-account" src="~/images/home-usermenu/UM_edit_inactive.png" />
@Localizer["Modify Profile"]
</a>
</li>
<li id="menu-li-openapp">
<a id="openNac" style="cursor: pointer;">
<img id="img-li-openapp" class="menu-icons-account" src="~/images/home-usermenu/UM_sharimg_inactive.png" />
@Localizer["Open Sharimg"]
</a>
</li>
<li id="menu-li-logoff">
<a style="cursor: pointer;">
<img id="img-li-logoff" class="menu-icons-account" src="~/images/home-usermenu/UM_logout_inactive.png" />
<button id="btn_submit" type="submit" style="color:black" class="btn btn-link pull-right">@Localizer["Log off"]</button>
</a>
</li>
</ul>
</li>
之前我还为Bootstrap工具提示和鼠标悬停图标
释放了javascript功能
答案 0 :(得分:-2)
我的Bootstrap版本和Jquery之间没有任何不兼容性。
我有两个问题:
1-我在关闭主布局.cshtml文件中的<body>
标记之前加载了所有js库,因此我无法在partials视图中执行Jquery代码,我只是在<header>
之后更改了位置我加载所有.js文件
2 - 由于这个错误,我试图在局部视图中再次加载所有JS文件,尽管这没有在控制台中显示任何错误,它会停止一些功能,因为Bootstrap下拉菜单