Skip to content

Instantly share code, notes, and snippets.

@dansimco
Created July 7, 2012 19:08
Show Gist options
  • Save dansimco/3067704 to your computer and use it in GitHub Desktop.
Save dansimco/3067704 to your computer and use it in GitHub Desktop.
touchUpInside
isTouchInside = function(e){
var event = e.originalEvent;
touch_inside = false;
if (! event.touches[0] ) return touch_inside;
touchX = event.touches[0].pageX;
touchY = event.touches[0].pageY;
if(
touchX > element_coords.left &&
touchX < element_coords.right &&
touchY > element_coords.top &&
touchY < element_coords.bottom
){
touch_inside = true;
}
return touch_inside;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment