troubleshooting Question

Onmousemove Killing Nested DIVs' Onclick

Avatar of fatfe
fatfe asked on
JavaScript
4 Comments1 Solution902 ViewsLast Modified:
Hey All,

I have some div's which have events assigned to them.  I have noticed when I comment out the onmousemove the swapBlocks function is triggered properly, but having onmousemove assigned to the parent div seems to kill any nested events. Also if I "unnest" the redblock div the onclick triggers normally.  Any ideas? The last thing I want to do is write a hitTest function.  I'm working strictly in IE5.5+.

HTML:

<div id="interrClip01">
      <div id="redblock"><img src="images/spacer.gif" border="0" width="15" height="15" /></div>
</div>

JS:

getElement("interrClip01").onmousemove = moveCrosshair;
getElement("redblock").onclick = swapBlocks;

// getElement is a custom function just returning document.getElementById().

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros