javascript - Add class with delay JQuery then remove and loop this function -


got problem need function work loop (or atleast think thats want).

it works first time enter #nav , leave second time want enter navigation addclass function not working.

$("#nav").mouseenter(function() {     $(".desktop a").delay(300).queue(function(){$(this).addclass('showhidden')}); }); $("#nav").mouseleave(function() {     $(".desktop a").removeclass("showhidden"); }); 

you need dequeue it:

$(".desktop a").dequeue().delay(300).queue(function(){$(this).addclass('showhidden')}); 

and:

$(".desktop a").dequeue().removeclass("showhidden"); 

or use:

 $(".desktop a").clearqueue().removeclass("showhidden"); 

Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -