JavaScript implementation of UIGestureRecognizer for Mobile Safari