Skip to content

Instantly share code, notes, and snippets.

@fi-tomek-augustyn
Last active December 12, 2015 01:38
Show Gist options
  • Save fi-tomek-augustyn/4692676 to your computer and use it in GitHub Desktop.
Save fi-tomek-augustyn/4692676 to your computer and use it in GitHub Desktop.
Gesture detection example: Identifying global events
<!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