I have a drop down menu in sidebar and it has links as menu items. When I click a menu item(link) then link works fine but drop down menu gets closed.
But I want that dropdown menu stay opened even after clicking a menu item.
HTML Code:
<div id="sidebar-wrapper">
<div class="sidebar-heading">Start Bootstrap </div>
<div class="list-group list-group-flush">
<a href="{% url 'shop:admin_orders_list' %}">All orders</a>
<button class="dropdown-btn button">Products
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
<a href="{% url 'shop:admin_products_list' %}">View Products</a>
<a href="{% url 'shop:admin_product_create' %}">Add New Product</a>
</div>
</div>
</div>
I tried these two following ways:
$('div.dropdown-container a').on('click', function(e) {
e.preventDefault();
});
$('div.dropdown-container a').on('click', function(e) {
e.stopPropagation();
});
But these two ways did not work.
Please help me to resolve it.
try this make sure to put your dropdown id there
$('#dropdownid').on('hide.bs.dropdown', function () {
return false;
});
Displaying Dynamic placeholder content on Textbox in ReactJS
Extracting Parameters from Redirect URI - QuickBooks API / Python
How to check if a function is running in worker thread in node?
How to take column from two table in whereExists clause in laravel 5.5
Cannot publish new release to Google Play because of Sensitive app permissions
I am trying to create a user in mongoose and return it after Usercreate query without password field
I want to use python3 to generate random password to encrypt my files, The random password created should have following restriction
I am taking a screenshot on my android app using this code: