Created
July 10, 2015 08:00
-
-
Save hansmaad/02165649496193bdb4b7 to your computer and use it in GitHub Desktop.
test file for Issue 506664: window.onpointerdown is null in version 45, was undefined before, breaks polyfills
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<div id="test" style="width:300px; height:300px; background:red;"> | |
</div> | |
<script> | |
var hasPointerEvents = 'onpointerdown' in window; | |
var e = hasPointerEvents ? 'pointerdown' : 'mousedown'; | |
var element = document.getElementById('test'); | |
element.addEventListener(e, function(event) { | |
element.innerHTML = e + ' @ ' + event.pageX; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment