I am using a bootstrap dropdown list but I have attached my own jQuery in it. My code is here
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown">User Name<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">Profile</a></li>
<li><a href="#">Logout</a></li>
</ul>
$('.dropdown-toggle').click(function () {
$('.dropdown-menu').slideToggle();
});
When I am not using jQuery, dropdown is being hidden on clicking outside the button (anywhere in body). But after using slideToggle function it's not being hide. I want the same effect as slideToggle()
function to hide dropdown!