Reputation: 25542
Is there anyway to interact with the DOM using jQuery that when a user hovers over a div a menu appears, but when they hover over a particular child element inside that parent, nothing happens?
Code so far
$('#player_area:not(< #player_links)').live("mouseenter", function() {
return $('#album_tracks').slideDown(200);
}).live("mouseleave", function() {
return $('#album_tracks').hide();
});
Upvotes: 4
Views: 10244
Reputation: 6414
The question is whether it is because you do not wish the action to be repeated with mouseenter events on the children. That is the event is already triggered by the parent and you don't want it to be performed again without first leaving the parent or whether you want the child to not trigger the mouseenter (if it has been positioned outside of the parent).
It seems that your code should work if you merely remove the :not selector.
Edit... Sorry misunderstood... The following fiddle should address what you needed to do
Upvotes: 0
Reputation: 2945
Here is what you need : http://api.jquery.com/mouseover/
mouseenter
and mouseleave
method.
Check the example demo ;)
Upvotes: 13