Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Modernizr/Modernizr
...
head fork: Modernizr/Modernizr
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 25 additions and 0 deletions.
  1. +25 −0 feature-detects/css-pointerevents.js
View
25 feature-detects/css-pointerevents.js
@@ -0,0 +1,25 @@
+
+// developer.mozilla.org/en/CSS/pointer-events
+
+// Test and project pages:
+// ausi.github.com/Feature-detection-technique-for-pointer-events/
+// github.com/ausi/Feature-detection-technique-for-pointer-events/wiki
+// github.com/Modernizr/Modernizr/issues/80
+
+
+Modernizr.addTest('pointerevents', function(){
+ var element = document.createElement('x'),
+ documentElement = document.documentElement,
+ getComputedStyle = window.getComputedStyle,
+ supports;
+ if(!('pointerEvents' in element.style)){
+ return false;
+ }
+ element.style.pointerEvents = 'auto';
+ element.style.pointerEvents = 'x';
+ documentElement.appendChild(element);
+ supports = getComputedStyle &&
+ getComputedStyle(element, '').pointerEvents === 'auto';
+ documentElement.removeChild(element);
+ return !!supports;
+});

No commit comments for this range

Something went wrong with that request. Please try again.