jQuery Hover event, prevent function from being fully executed -


First thing first, I have a little hard to understand, because English is not my native language, then forgive the mess.

I wrote a small notification function, which is triggered on the form. General behavior is:

  • User submits form
  • Notes in notes
  • 2 seconds delay
  • Note fade out

    When the note is filled, it is spread by css-transition . Logically, it should not be faded, as long as the user does not fall through the mouseleave .

    I tried to do something like

      
      if ($ ('# notice'). Hover ()) {return; }   

    But of course, the first statement has already been shown here:

    I also tried some other things , Like the different scripts that are listening to the hover event, then calling $ ('# Notification'). Show ();

    Neither works. I know that this is a simple error in logic, but hell, I'm stuck.

    Thanks in advance.

    after faidin call setTimeout With the function:

    • If the notifications have collapsed, hide it
    • Otherwise, to hide it when you lose the mouse focus, .mouseleave < Use / code>.

      i.e.:

        $ ('# Notification') fadein (500). Setteimeout (function () (if (notification_is_collapsed) $ ('# notice'). FadeOut (500); Other $ ('# Notifications') .moveleave (function () {$ ('# notice'). FadeOut (500) ;});}, 2000);    

Comments