From 3caac3e80e3a0eef2c481698de777a308d275d54 Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Thu, 8 May 2014 16:34:43 -0400 Subject: grunt stuffffff --- js/vendor/jquery-nodoubletapzoom.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 js/vendor/jquery-nodoubletapzoom.js (limited to 'js/vendor/jquery-nodoubletapzoom.js') diff --git a/js/vendor/jquery-nodoubletapzoom.js b/js/vendor/jquery-nodoubletapzoom.js new file mode 100644 index 0000000..3e45c82 --- /dev/null +++ b/js/vendor/jquery-nodoubletapzoom.js @@ -0,0 +1,19 @@ +;(function($) { + var IS_IOS = /iphone|ipad/i.test(navigator.userAgent); + $.fn.nodoubletapzoom = function() { + if (IS_IOS) + $(this).bind('touchstart', function preventZoom(e) { + var t2 = e.timeStamp + , t1 = $(this).data('lastTouch') || t2 + , dt = t2 - t1 + , fingers = e.originalEvent.touches.length; + $(this).data('lastTouch', t2); + if (!dt || dt > 500 || fingers > 1) return; // not double-tap + + e.preventDefault(); // double tap - prevent the zoom + // also synthesize click events we just swallowed up + $(this).trigger('click').trigger('click'); + }); + return this; + }; +})(jQuery); \ No newline at end of file -- cgit v1.2.3-70-g09d2