Template:Team:HokkaidoU Japan/JS

From 2014.igem.org

(Difference between revisions)
Line 280: Line 280:
$(this).unbind( touchMoveEvent, moveHandler);
$(this).unbind( touchMoveEvent, moveHandler);
// if start and stop contain data figure out if we have a swipe event
// if start and stop contain data figure out if we have a swipe event
-
if ( and(start , stop ) {
+
if ( and(start , stop {
// calculate the distance between start and stop data
// calculate the distance between start and stop data
var deltaX = Math.abs(start.coords[0] - stop.coords[0]),
var deltaX = Math.abs(start.coords[0] - stop.coords[0]),
deltaY = Math.abs(start.coords[1] - stop.coords[1]),
deltaY = Math.abs(start.coords[1] - stop.coords[1]),
-
distance = Math.sqrt(deltaX*deltaX+deltaY*deltaY);
+
distance = Math.sqrt(deltaX*deltaX+deltaY*deltaY));
// check if the delay and distance are matched
// check if the delay and distance are matched

Revision as of 10:28, 15 September 2014