javascript - jQuery - slideDown on mouseenter > delay > SlideUp on mouseleave -


I have created a very simple jQuery sliding function, but need improvement, the original timeline of the function is required: < / P>

  1. Slide down on the mousester
  2. Unless the mouse moves
  3. Be visible

^^ This works, But if you slide up and down several times, the function stops working for a few seconds. Can someone please suggest solutions? JS FIDDLE Attached

JSFIDDLE:

  $ (document) .ready (function () {$ hover = true; $ ("#slide") .mouseenter (function ($ Hover = hidden) {$ (".slide - hidden") .Sliddown ('sharp');}}); $ ("#slide") .mouseleave (function () {$ hover = false; $ ( ".slide - hidden") .delay (2000) .slideUp ('fast'). Queue (function () {enableHover (); $ (this) .dequeue ();});}); function enabled () { $ Hover = true;}});  

Change your javascript with this if I If you understand your problem properly, then it works very well.

  $ (document). Ready (function () {var (the timeout; $ ('# slide'). Mouseover (function () {clearTimeout $ ('slide - hidden'). SlideDown ();}); $ ('# slide') MouseLove (function () (thetimeout = setTimeout {$ ('slide-hidden'). SlideUp ();}, 2000);});});  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -