slideToLoop.js 432 B

12345678910111213141516171819202122
  1. export default function slideToLoop(index, speed, runCallbacks, internal) {
  2. if (index === void 0) {
  3. index = 0;
  4. }
  5. if (speed === void 0) {
  6. speed = this.params.speed;
  7. }
  8. if (runCallbacks === void 0) {
  9. runCallbacks = true;
  10. }
  11. const swiper = this;
  12. let newIndex = index;
  13. if (swiper.params.loop) {
  14. newIndex += swiper.loopedSlides;
  15. }
  16. return swiper.slideTo(newIndex, speed, runCallbacks, internal);
  17. }