Add a quick test for multitouch. If you can't get the number reported higher
than one, your browser doesn't support multitouch. git-svn-id: http://svn.openlayers.org/trunk/openlayers@11545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
22
examples/multitouch.html
Normal file
22
examples/multitouch.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Multitouch Test</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="width:80%; height: 80%; border: 1px solid black; font-size: 5em;" id="box">
|
||||
</div>
|
||||
Touch inside the box. On a touch enabled browser, you will get the number
|
||||
of detected touch events. If the box is red, your browser does not support
|
||||
touch events.
|
||||
<script>
|
||||
var box = document.getElementById("box");
|
||||
box.addEventListener("touchstart", function(evt) {
|
||||
box.innerHTML = evt.touches.length;
|
||||
evt.preventDefault();
|
||||
});
|
||||
if (!(typeof box.ontouchstart != 'undefined')) {
|
||||
box.style.backgroundColor = "red";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user