S
S
skolm2022-03-25 03:24:40
Slider
skolm, 2022-03-25 03:24:40

How to make tinySlider not lag when switching tabs?

I use this thing:
https://github.com/ganlanyuan/tiny-slider

html:

<div class="container">
  <div class="slider">
    ...
  </div>
</div>

js:
var sliderBase = tns ({
    container: '.slider',
    items: 2,
    autoplay: true, 
    nav: false,
    controls: false,
    prevButton: false,
    nextButton: false,
    controlsPosition: false, 
    controlsText: false, 
    controlsContainer: false, 
    touch: true, 
    autoplayTimeout: 3000, 
    speed: 12000, 
    slideBy: "page", 
    preventScrollOnTouch: true,
    mouseDrag: true,
    swipeAngle: false,
    autoplayButton: false, 
    autoplayButtonOutput: false,
});


Further, if I started autoscrolling and, for example, went to another tab, after returning to the slider, it lags terribly. How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question