0

我有一个普通的引导导航栏,上面有一些下拉菜单。当我单击下拉菜单中的链接时,屏幕上会出现模式框,当我退出模式框然后尝试再次单击导航栏上的下拉菜单时,它将不起作用,下拉菜单周围会出现橙色方形边框好像它无法再次获得焦点或什么的。任何想法为什么会发生这种情况?

<div class="navbar navbar-inverse navbar-fixed-top ">

<div class="navbar-inner" id="background">
    <a class="brand" href="@Url.Action("RssIndex", "Home")">
        <img src="~/Images/iconnewzy.png" alt="Newzy" ></a>

         <ul class="nav">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user"></i>
                            <label style="display: inline; cursor: pointer;" id="friendsId">Friends</label><b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <a href="#" class="btn btn-mini btn-primary" onclick="AddFriend()" style="width: 50%; white-space: nowrap; color: white; margin-left: 20px !important;">Add Friend</a>
                            <a href="#" class="btn btn-mini btn-primary" onclick="ViewFriends()" style="width: 50%; white-space: nowrap; color: white; margin-left: 20px !important;">View Friends</a>
                        </ul>

                    </li>
                    <b style="vertical-align: bottom !important; color: white">Hello, <a href="#" onclick="createManageModal()" style="color: white !important; vertical-align: bottom !important;">@User.Identity.Name</a>!</b>
                    @Html.ActionLink("Log off", "LogOff", "Account", routeValues: null, htmlAttributes: new { @class = "btn btn-mini btn-primary" })
         </ul>
 </div>
 </div>
4

1 回答 1

0

我有同样的问题。我在这篇文章中找到了解决方法。基本上,您必须将此代码添加到您的页面:

$(function() {
  // Setup drop down menu
  $('.dropdown-toggle').dropdown();

  // Fix input element click problem
  $('.dropdown input, .dropdown label').click(function(e) {
    e.stopPropagation();
  });
});
于 2013-03-08T13:46:33.637 回答