The start of the function when the page loads and when you resize?

Good afternoon.

There is a plugin scrollbox - automatic slider.

I need that when the screen width less than 1024 work of the slider is stopped.

Now doing so
function slidecase($play){
$('.slider').scrollbox({
 direction: 'h',
 linear: true
 step: 1,
 delay: 0,
 speed: 25,
 autoPlay: $play
});
}

activationSlide function(){
$(window).resize(function(){
 if(innerWidth >= 1024){
slidecase(true);
}
else{
slidecase(false);
}
});
 if(innerWidth >= 1024){
slidecase(true);
}
else{
slidecase(false);
}
}

activationSlide();


ie pass through the function parameter is set to automatic scrolling.

When reduced to < 1024 slider does not stop, and Vice versa, the scrolling begins to speed up.
June 10th 19 at 14:59
0 answer

Find more questions by tags jQueryJavaScript