[OpenLayers-Commits] r11545 - trunk/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Sat Feb 26 04:56:44 EST 2011


Author: crschmidt
Date: 2011-02-26 01:56:43 -0800 (Sat, 26 Feb 2011)
New Revision: 11545

Added:
   trunk/openlayers/examples/multitouch.html
Log:
Add a quick test for multitouch. If you can't get the number reported higher
than one, your browser doesn't support multitouch.


Added: trunk/openlayers/examples/multitouch.html
===================================================================
--- trunk/openlayers/examples/multitouch.html	                        (rev 0)
+++ trunk/openlayers/examples/multitouch.html	2011-02-26 09:56:43 UTC (rev 11545)
@@ -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>  



More information about the Commits mailing list