Server IP : 162.0.232.140 / Your IP : 3.133.100.106 Web Server : LiteSpeed System : Linux premium139.web-hosting.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : micrcvoy ( 740) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/micrcvoy/microleess-uae.store/controlPanel/assets/plugins/magnific-popup/src/js/ |
Upload File : |
/** * FastClick event implementation. (removes 300ms delay on touch devices) * Based on https://developers.google.com/mobile/articles/fast_buttons * * You may use it outside the Magnific Popup by calling just: * * $('.your-el').mfpFastClick(function() { * console.log('Clicked!'); * }); * * To unbind: * $('.your-el').destroyMfpFastClick(); * * * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound. * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick * */ (function() { var ghostClickDelay = 1000, supportsTouch = 'ontouchstart' in window, unbindTouchMove = function() { _window.off('touchmove'+ns+' touchend'+ns); }, eName = 'mfpFastClick', ns = '.'+eName; // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way $.fn.mfpFastClick = function(callback) { return $(this).each(function() { var elem = $(this), lock; if( supportsTouch ) { var timeout, startX, startY, pointerMoved, point, numPointers; elem.on('touchstart' + ns, function(e) { pointerMoved = false; numPointers = 1; point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0]; startX = point.clientX; startY = point.clientY; _window.on('touchmove'+ns, function(e) { point = e.originalEvent ? e.originalEvent.touches : e.touches; numPointers = point.length; point = point[0]; if (Math.abs(point.clientX - startX) > 10 || Math.abs(point.clientY - startY) > 10) { pointerMoved = true; unbindTouchMove(); } }).on('touchend'+ns, function(e) { unbindTouchMove(); if(pointerMoved || numPointers > 1) { return; } lock = true; e.preventDefault(); clearTimeout(timeout); timeout = setTimeout(function() { lock = false; }, ghostClickDelay); callback(); }); }); } elem.on('click' + ns, function() { if(!lock) { callback(); } }); }); }; $.fn.destroyMfpFastClick = function() { $(this).off('touchstart' + ns + ' click' + ns); if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns); }; })();