Skip to content
Snippets Groups Projects
Commit 1478e163 authored by Ivan Sanchez Milara's avatar Ivan Sanchez Milara
Browse files

Submenu appear and dissapear without need of pressing buttons

parent 68bdf8be
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,28 @@ $("li.disabled a").click(function() {
});
/*Working with submenus*/
$('.dropdown-submenu > a').on("click", function(e) {
var submenuTimer;
$('.dropdown-submenu > a').on("mouseenter", function(e) {
var submenu = $(this);
$('.dropdown-submenu .dropdown-menu').removeClass('show');
submenu.next('.dropdown-menu').addClass('show');
e.stopPropagation();
submenuTimer = setTimeout(function() {
$('.dropdown-submenu .dropdown-menu').removeClass('show');
submenu.next('.dropdown-menu').addClass('show');
}, 300);
});
$('.dropdown-submenu > a').on("mouseleave", function(e) {
clearTimeout(submenuTimer);
});
$('.dropdown-menu').on("mouseleave", function(e) {
leaveTimer = setTimeout(function() {
$('.dropdown-menu.show').removeClass('show');
}, 250);
});
$('.dropdown-menu').on("mouseenter", function(e) {
clearTimeout(leaveTimer);
});
$('.dropdown').on("hidden.bs.dropdown", function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment