Question

I have been looking for a way to enable clickthrough of layers on internet explorer 9 and this is one of the best answer I found so far. This is obviously not working in the little jsfiddle I made here. Note that I am using the real internet explorer 9 and not internet explorer 10 in compatibility mode (which works btw). Is there a way to make that work?

HTML:

<svg width="100px" height="100px" style="position:relative;background:#aaaaaa;z-index:100;pointer-events:none;"></svg>
<div onclick="alert('it worked!');" style="position:absolute;top:10px">Click me</div>
Was it helpful?

Solution

I noticed 2 problems with your implementation. First, you must wrap the element you want to click with the svg. You just put the div you want to click AFTER the svg and not INSIDE. Second, you div has no size so its almost impossible to click, so I added a width and height to it

<div onclick="itworked();" style="position:absolute; top:0; left:0; width:100%; height:100%">Click me</div>

I implemented this modifications to your fiddle and it worked, at least for me, in here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top