Last active
December 12, 2015 01:38
-
-
Save fi-tomek-augustyn/4692676 to your computer and use it in GitHub Desktop.
Gesture detection example: Identifying global events
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> | |
<head> | |
<title>Gesture detection example</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<style> | |
.gestureSurface { | |
width: 640px; | |
height: 480px; | |
background-color: red; | |
-ms-touch-action: none; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="gestureSurface"></div> | |
<script> | |
// Set up gesture recognition on the gesture surface | |
var surface = document.querySelector('.gestureSurface'); | |
// Initialise MSGesture | |
var msGesture = new MSGesture(); | |
// Set the target element | |
msGesture.target = surface; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment