I have a bootstrap dropdown menu on my navbar and it opens whenever I hover over the link. However, it has become annoying because on certain screens in my application I have buttons near the top right of the screen and when users move their mouse near the buttons, the dropdown opens on the hover. I'd rather just have it open only when you click on the link.
<ul class="nav navbar-nav navbar-right">
<li role="presentation" class="dropdown">
<a href="#" class="dropdown-toggle" style="font-size: medium" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="glyphicon glyphicon-user"></i> @User.Identity.GetDisplayName()
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("User Admin", "Index", "Users")</li>
<li role="separator" class="divider"></li>
<li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
<li role="separator" class="divider"></li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</li>
</ul>