Last active
January 4, 2016 04:59
-
-
Save codexico/8572143 to your computer and use it in GitHub Desktop.
CSS pointer-events
============= CSS' pointer-events property effectively disable an element when the value is none but otherwise allow the element to function per usual when the value isn't none. Pointer-events even prevent JavaScript events from firing. Click on that element and any addEventListener callback you've placed on the element will n…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.disabled { pointer-events: none; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CSS pointer-events
CSS' pointer-events property effectively disable an element when the value is none but otherwise allow the element to function per usual when the value isn't none. Pointer-events even prevent JavaScript events from firing.
Click on that element and any addEventListener callback you've placed on the element will not fire. A perfect property, really -- you don't need to do a className check before you decide whether or not to fire something based on class presence.
http://davidwalsh.name/pointer-events