I have an image that may have some divs above it (indicating specific choices in this image). These divs must be interactive. Something like that:
#divOuter { width: 500px; height: 500px; border: 2px solid #0000FF; position: relative; } #divInner { width: 100px; height: 100px; border: 2px solid #00FF00; position: absolute; cursor: pointer; top: 20px; left: 20px; } <div id="divOuter"> <img src="SomeImage.jpg" /> <div id="divInner"></div> </div> $("#divOuter").click(function() { alert("divOuter"); }); $("#divInner").click(function() { alert("divInner"); });
In chrome and FF, it works as expected (a pointer appears above the div, and clicking on it warns "divInner" and then "divOuter").
However, this did not happen in IE8 - I got the same behavior only when hovering / clicking on the inner borders of a div. When clicking inside this div, only "divOuter" was warned.
How can this be fixed?
javascript html css
Kuzco
source share