Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add make touchstart passive in jquery "3.4.0"

jQuery.event.special.touchstart = {
            setup: function (_, ns, handle) {
                this.addEventListener('touchstart', handle, { passive: !ns.includes('noPreventDefault') });
            }
        };
        jQuery.event.special.touchmove = {
            setup: function (_, ns, handle) {
                this.addEventListener('touchmove', handle, { passive: !ns.includes('noPreventDefault') });
            }
        };
 
PREVIOUS NEXT
Tagged: #add #touchstart #passive #jquery
ADD COMMENT
Topic
Name
1+7 =