The problem is that bind
adds an event listener, and not replace it. So you are adding several listeners each time you resize. Instead, you could just check the width inside it.
$('.swiper-container').on('mousewheel', function(event, delta) {
if($(window).width() >= 970) {
this.scrollLeft -= (delta * event.deltaFactor);
event.preventDefault();
} else {
this.scrollTop -= (delta * event.deltaFactor);
}
});
Also, use on
instead of bind
. You also don't need the else
part if what you want is the default behaviour.