Karl Forshaw

Categories Archives
More from me
Projects
Recommendations
Currently Reading
Shelfari: Book reviews on your book blog

Event Propagation in jQuery

Published on Monday, November 30, 2009 by Karl

I’ve been working on an experimental version of One Panel recently. Shhh – It’s a secret. Anyway, I decided to switch from Prototype to jQuery to minimize plugin conflicts that sometimes occur with the existing software. This is just a little post to hopefully save some people the time I spent on this when moving to jQuery.

Now to the problem – mouseover. I was attempting to add a mouseover event to every div on the page to mimic Firebug’s “inspect” functionality. The problem is that for every div I moused over, the event was triggered for every div up the DOM tree to the top most parent. This is actually intended behavior. Its called “Event Propagation”. It can be prevented however using the event.stopPropagation() function.

Hope this helps someone in the future :)

Tags:
No comments currently exist for this post.
Leave your comment:
You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>