jQuery-slimScroll
jQuery-slimScroll copied to clipboard
[Violation] output in chrome console
[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Chrome output above violation message after chrome v51, please refer this.
@Argun have you got any solution yet for this?
have update slimscroll..js function attachwheel(target) with
function attachWheel(target) { if (window.addEventListener) { target.addEventListener('DOMMouseScroll', _onWheel, { capture: false, passive: false }); target.addEventListener('mousewheel', _onWheel, { capture: false, passive: false }); } else { document.attachEvent("onmousewheel", _onWheel) } }
still getting error in some places,
@Argun have you got any solution yet for this?
have update slimscroll..js function attachwheel(target) with
function attachWheel(target) { if (window.addEventListener) { target.addEventListener('DOMMouseScroll', _onWheel, { capture: false, passive: false }); target.addEventListener('mousewheel', _onWheel, { capture: false, passive: false }); } else { document.attachEvent("onmousewheel", _onWheel) } }
still getting error in some places,
you can use the following code to distinguish whether the passive attribute is supported.
var supportsPassive = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassive = true;
}
});
window.addEventListener("test", null, opts);
} catch (e) {}