S
S
Sasha_beg2019-09-06 08:03:38
JavaScript
Sasha_beg, 2019-09-06 08:03:38

I get the error [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See?

Hello! I am a beginner. Please tell me, this error pops up in the console [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See
And there is this script

$(function(){

$('body').on('mousewheel', function(e){
if(noScrollMode){return;};
e.preventDefault();
e.stopPropagation();
if( isAnimating ) {
return false;
}
isAnimating = true;
// Increase or reset current anchor
if( e.originalEvent.wheelDelta > 0 ) {
currentAnchor--;
}
if( e.originalEvent.wheelDelta < 0 ) {
currentAnchor++;
}
anchorMagik();
if( currentAnchor < 0 ) {
currentAnchor = 0;
}
if( currentAnchor > (anchors.length - 1)) {
currentAnchor = anchors.length - 1;
}
$('.fp-nav').each(function(){
$(this).removeClass('active');
if (currentAnchor == $(this).attr("num")){
$(this ).addClass('active');
};
});
updatePagePos();
});

What could be the problem?
Thank you very much!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-09-06
@Rsa97

https://igoradamenko.com/blog/v3/passive-touch-events/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question