Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter alanfi

    (@alanfi)

    Thank you very much for the reply

    I solved the problem

    It is some line of the following code

    jQuery(document).ready(function($){
    // Custom jQuery goes here
    //Uses passive listeners to improve scrolling performance
    (function() {
    var supportsPassive = eventListenerOptionsSupported();

    if (supportsPassive) {
    var addEvent = EventTarget.prototype.addEventListener;
    overwriteAddEvent(addEvent);
    }

    function overwriteAddEvent(superMethod) {
    var defaultOptions = {
    passive: true,
    capture: false
    };

    EventTarget.prototype.addEventListener = function(type, listener, options) {
    var usesListenerOptions = typeof options === ‘object’;
    var useCapture = usesListenerOptions ? options.capture : options;

    options = usesListenerOptions ? options : {};
    options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive;
    options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture;

    superMethod.call(this, type, listener, options);
    };
    }

    function eventListenerOptionsSupported() {
    var supported = false;
    try {
    var opts = Object.defineProperty({}, ‘passive’, {
    get: function() {
    supported = true;
    }
    });
    window.addEventListener(“test”, null, opts);
    } catch (e) {}

    return supported;
    }
    })();
    //end Uses passive listeners to improve scrolling performance

    });

Viewing 1 replies (of 1 total)