Bongs
Bongs

Reputation: 5592

jQuery Fading effect occuring multiple times

I am trying to write a simple jQuery script to apply fading effect on footer. On mouseover event, it fades in with opacity = 1, and on mouse out event it fades out to opacity 0.01. I have applied this effect on parent div. The problem is, everytime I move mouse over child elements, it triggers the event and makes the div blink multiple times. How can I stop it? I want the mouseover and mouseout event to trigger when I hover over parent div and not when I move mouse inside the parent div.

Here is the situation

Thanks for any help in advance... :)

Upvotes: 2

Views: 1173

Answers (1)

Jon
Jon

Reputation: 12992

You should be able to use the stop() function to prevent this: http://api.jquery.com/stop/

$(this).stop().fadeTo("fast",1.00);
$(this).stop().fadeTo("fast",0.01);

http://jsfiddle.net/w7Vbu/7/

Upvotes: 3

Related Questions