0
我有2個下拉列表一個正在工作,但另一個不工作在移動視圖。點擊移動視圖中的切換底部之後,只有第一個下拉菜單中的下拉列表中的其餘下拉列表不起作用。爲什麼只有一個dropown工作休息下拉列表不起作用。下拉列表不能在移動視圖中工作
<body>
<form id="form1" runat="server">
<link rel="stylesheet" href='http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css'
media="screen" />
<script type="text/javascript" src='http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js'></script>
<script type="text/javascript" src='http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js'></script>
<div class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
aria-expanded="false">
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span
class="icon-bar"></span><span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" RenderingMode="List"
IncludeStyleBlock="false" StaticMenuStyle-CssClass="nav navbar-nav" DynamicMenuStyle-CssClass="dropdown-menu">
<Items>
<asp:MenuItem Text="Drop Down" NavigateUrl="#">
<asp:MenuItem Text="two" NavigateUrl="#" />
<asp:MenuItem Text="three" NavigateUrl="#" />
<asp:MenuItem Text="six" NavigateUrl="#" />
</asp:MenuItem>
<asp:MenuItem Text="Drop Down 2" NavigateUrl="#">
<asp:MenuItem Text="four" NavigateUrl="#" />
<asp:MenuItem Text="five" NavigateUrl="#" />
<asp:MenuItem Text="six" NavigateUrl="#" />
</asp:MenuItem>
</Items>
</asp:Menu>
</div>
</div>
</div>
<script type="text/javascript">
//Disable the default MouseOver functionality of ASP.Net Menu control.
Sys.WebForms.Menu._elementObjectMapper.getMappedObject = function() {
return false;
};
$(function() {
//Remove the style attributes.
$(".navbar-nav li, .navbar-nav a, .navbar-nav ul").removeAttr('style');
//Apply the Bootstrap class to the SubMenu.
$(".dropdown-menu").closest("li").removeClass().addClass("dropdown-toggle");
//Apply the Bootstrap properties to the SubMenu.
$(".dropdown-toggle").find("a").eq(0).attr("data-toggle", "dropdown").attr("aria-haspopup", "true").attr("aria-expanded", "false").append("<span class='caret'></span>");
//Apply the Bootstrap "active" class to the selected Menu item.
$("a.selected").closest("li").addClass("active");
$("a.selected").closest(".dropdown-toggle").addClass("active");
});
</script>
<hr />
</form>
</body>