Swiper: Different speeds for manual interactions vs. autoplay

Created on 22 Apr 2015  路  3Comments  路  Source: nolimits4web/swiper

How do you usually implement different speeds for manual interactions vs. autoplay? Having a slow slide change looks good for autoplay, but a slow change speed feels bad for swiping on a mobile device.

After looking though the API I managed to change the speed of the navigation buttons by doing this:

    $swiperContainer.find(".swiper-button-next").click ->
        swiper.slideNext(true, manualSlideChangeSpeed)

But that does not change the speed for swipes and other methods of changing slide.

Most helpful comment

you need to change speed parameter using, for example:

var swiper = new Swiper(..., {
  ...
  speed: 2000,
  onTransitionEnd: function(swiper){
    swiper.params.speed = 2000;
  },
  onTouchStart: function(swiper){
    swiper.params.speed = 400;
  },
  onTransitionStart: function (swiper) {
    swiper.params.speed = 400;  
  }
});

All 3 comments

you need to change speed parameter using, for example:

var swiper = new Swiper(..., {
  ...
  speed: 2000,
  onTransitionEnd: function(swiper){
    swiper.params.speed = 2000;
  },
  onTouchStart: function(swiper){
    swiper.params.speed = 400;
  },
  onTransitionStart: function (swiper) {
    swiper.params.speed = 400;  
  }
});

Closing as no further discussion

With version 4.2.2:

var swiper = new Swiper(..., {
  ...
  speed: 2000,
  on: {
    transitionEnd: function () {
      swiper.params.speed = 2000;
    },
    touchStart: function () {
      featuredSwiper.params.speed = 400;
    },
  },
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

QJan84 picture QJan84  路  3Comments

durchanek picture durchanek  路  4Comments

cristianfierro picture cristianfierro  路  4Comments

syedongit picture syedongit  路  3Comments

callumacrae picture callumacrae  路  3Comments