When you go to any of the menu items in the sidebar, it closes, the page that you clicked on is loaded, and the menu in the sidebar opens again. How to make sure that the menu does not close during the transition and thus does not blink.
2 answers
Try to hang the opening event of a submenu only on the upper level, and not on all descendants. Now you have so
$('.menu li').click(function() { $(this).find("ul").slideToggle(); $(this).find('span').toggleClass('red'); }); try this
$('.menu > li').click(function() { $(this).find("ul").slideToggle(); $(this).find('span').toggleClass('red'); }); |
If the decision of Alexander does not help. You can try to stop babbling. Below this piece of code
$('.menu li').click(function() { $(this).find("ul").slideToggle(); $(this).find('span').toggleClass('red'); }); need to add
$("li a").click(function(e) { e.stopPropagation(); }); Fully block should look like this:
$(function() { $('.menu li').click(function() { $(this).find("ul").slideToggle(); $(this).find('span').toggleClass('red'); }); $("li a").click(function(e) { e.stopPropagation(); }); }); - Alexandra did not help, inserted your code, it stopped folding, but a new page opens, and the site bar can be closed, and in a second it will open without animation, as if blinking is easy
|