First things first, i find this one a little difficult to explain, as english is not my native language. So excuse the mess.
I wrote a little notification function, which is triggered on form submit. Normal behaviour is:
- User submits form
- Note fades in
- 2 second delay
- Note fades out
When the note is hovered, it expands by css-transition. Logically, it should not fade out until the user collapses it by mouseleave.
And here lies my problem: How do i prevent the fadeOut Statement from being executed, as long as the div is hovered?
I tried something like
if ($('#notification').hover()){
return ;
}
but of course, the first statement is already excuted as shown here:
I also tried a few other things, like a seperate script which is listening on the hover event, then calling $('#notification').show() ;
Neither works. I know this is a simple error in reasoning, but hell, i am stuck.
Thanks in advance.
After the
fadeIncallsetTimeout, with a function that:.mouseleaveto hide it once it looses mouse focus.ie: