Touch through an element in a browser (like pointer-events: none)
Perhaps this should've been obvious, but I found an answer. Only doing pointer-events: none
does work, but only rarely, and I have to move my fingers around quickly to get it to trigger right. In order to make it work 100%, I added a touchstart
event listener to the overlay element, like so:
overlay.addEventListener('touchstart', function(e){
e.preventDefault();
});
This seems a bit silly, but maybe it has to do with how CSS and JavaScript are stepping on each other's toes these days. I don't know.
Interestingly, without e.preventDefault()
, it still works, but not 100% of the time. I'm not sure that line is strictly required for this operation to work correctly.
Edit: This is in Android Chrome 31.0.1650.59 by the way.
CSS pointer-events='none' and/or XUL mousethrough='always' in web pages for Firefox
Try this jQuery solution: http://jsbin.com/uhuto
Works in Firefox, Chrome, iPad's Safari, and IE8 at least. The only issue I saw was that the overlay wasn't translucent in IE, but I assume that's something that can be overcome.
Another solution (used by an Ext JS plugin): http://www.vinylfox.com/forwarding-mouse-events-through-layers/ - uses Javascript to reforward the events.
Disabling pointer events for inspect element
According to this https://code.google.com/p/chromium/issues/detail?id=136887 it is proper behaivor.
What was before (when you can't inspect elements with "pointer-events:none") was a bug.
Chromium has tests for this fix: https://chromium.googlesource.com/chromium/blink.git/+/dfcf6a3782dcae5dd16baec94040b931b0791fa6/LayoutTests/inspector/elements/inspect-pointer-events-none.html
`pointer-events: none;` does not work for iframe in Edge
After a farther investigation, it seems that this is a bug in Edge v16 (Edge/16.16299), everything works fine in Edge v15 and below.
So, be careful: in Edge v16, pointer-events: none;
does not affect the iframes in any way, even if you applied it to the parent container.
UPD: I had submitted the bug report to the Edge development team, they have fixed it in April release or so
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14961910/
Related Topics
Beginner's Stuff: How to Stop CSS' Divs from Overlapping
Compact Arrangement of Divs in Two Directions
How to Give a Title Tag a Color and Different Font
How to Use Div Class and Id Together in CSS
How to Make a Div Fill The Remaning Vertical Space Using CSS
What Is The Default Width of an HTML Table Cell <Td>
Position Fixed Not Working in Safari Version 8.0.2
Drop Shadow on a Div Container
Left Align Text and Right Align Image in CSS
Auto-Generate Div Ids for Bootstrap Accordion Menu Binding with Knockout Js
Div Background Color Not Showing with Body Color
Div Has No Height Even If It Has Content
How to Make The Scrollbar on a Div Only Visible When Necessary
How to Make Bootstrap Table Rows Clickable
How to Keep a Div Always on The Screen, But Not Always in a Fixed Position
Supporting Multiple Resolution and Density of Images in Phonegap