In the Keen Slider documentation, defaultAnimation
is supposed to set the animation for moveToIdx
, next
, and prev
functions. However, it only affects next
and prev
, not moveToIdx
. I can change the animation duration for button clicks but not for swiping. Here’s the reproduction of the issue: https://stackblitz.com/edit/nuxt-starter-wuvuih?file=app.vue.
If we take a look at the unminified keen-slider source code and go to line 436
-https://codepen.io/simulant144/pen/WNqJvqz, there was a duration set to 500ms
by default. If we change it to n.options.duration
and then go to the line 825
and change this duration to let’s say 5000ms
it starts to work. Is there a built-in way to set the animation duration and easing type to something like cubic-bezier(0.25, 0.1, 0.25, 1
particularly for swiping without going deep into the source code and changing it manually?
const current = ref(0);
const [container, slider] = useKeenSlider({
slides: {
perView: 1,
spacing: 15,
},
initial: current.value,
slideChanged: (s) => {
current.value = s.track.details.rel;
},
defaultAnimation: {
duration: 1300, // works only for navigation buttons and when clicking on gallery thumbnails, but not when swiping
},
});
Looking forward for a possible solution.