This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Hover effect and propagation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Hover effect and propagation." Watch "Hover effect and propagation." New topic

Hover effect and propagation.

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 415


I have a drop down menu. See jsfiddle. When I over on Programming it shows me a dropdown. But when I hover over first element in this case Java. It run the event on parent as well. I am not sure what is the issue. In case I try to stop propagation. It doesn't work properly see jsfiddle. Please let me know if I am doing something wrong.

Pawan Chopra
Rob Crowther
Ranch Hand

Joined: Nov 06, 2012
Posts: 297

Your problem is that you're capturing hover events on all elements - UL, LI and A. Try checking the nodeName property of the target before initiating your animation. Example.

Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
I agree. Here's the link:
subject: Hover effect and propagation.
It's not a secret anymore!