css 'pointer-events' property alternative for IE
Here is another solution that is very easy to implement with 5 lines of code:
- Capture the 'mousedown' event for the top element (the element you want to turn off pointer events).
- In the 'mousedown' hide the top element.
- Use 'document.elementFromPoint()' to get the underlying element.
- Unhide the top element.
- Execute the desired event for the underlying element.
Example:
//This is an IE fix because pointer-events does not work in IE
$(document).on('mousedown', '.TopElement', function (e) {
$(this).hide();
var BottomElement = document.elementFromPoint(e.clientX, e.clientY);
$(this).show();
$(BottomElement).mousedown(); //Manually fire the event for desired underlying element
return false;
});
Pointer-events is a Mozilla hack and where it has been implemented in Webkit browsers, you can't expect to see it in IE browsers for another million years.
There is however a solution I found:
Forwarding Mouse Events Through Layers
This uses a plugin that uses some not well known/understood properties of Javascript to take the mouse event and send it to another element.
There is also another Javascript solution here.
Update for October 2013: apparently it's coming to IE in v11. Source. Thanks Tim.