Created
January 21, 2021 00:23
-
-
Save neodigm/ad911a30dd142e741b40dfe6aa946e5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doTwoTouch = (function( _d, _q){ // Capture Pinch attempt on carousel | |
var eCntr, aEv=[]; | |
setTimeout(function(){ | |
if( oTopmenu && oTopmenu.isMobile() ) doTwoTouch.init(); | |
}, 2800); | |
return { | |
"init": function(){ | |
eCntr = _d.querySelector( _q[0] ); | |
if( eCntr ){ | |
eCntr.addEventListener("pointerdown", doTwoTouch.twoTouchDown ); | |
eCntr.addEventListener("pointerup", doTwoTouch.twoTouchUp ); | |
eCntr.addEventListener("pointercancel", doTwoTouch.twoTouchUp ); | |
eCntr.addEventListener("pointerout", doTwoTouch.twoTouchUp ); | |
eCntr.addEventListener("pointerleave", doTwoTouch.twoTouchUp ); | |
} | |
}, | |
"twoTouchDown": function( ev ){ | |
if( eCntr ){ | |
aEv.push( ev ); | |
if( aEv.length > 1) vltdc_productdetail.doTapToZoom(); | |
} | |
}, | |
"twoTouchUp": function( ev ){ | |
if( eCntr ){ | |
aEv = aEv.filter(function( _ev ){ | |
return ( _ev.pointerId !== ev.pointerId ); }); | |
} | |
} | |
}; | |
})( document, ["#js-flick__hero--id"] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Determine if the user attempted to pinch zoom on a carousel image.