You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted this issue on nuxt-keen-slider github page modbender/nuxt-keen-slider#1, but I think it also makes sense to post it here, since it's related to the carousel options.
Issue:
In the documentation in says 'defaultAnimation sets the default animation of the functions moveToIdx, next and prev'. However, it looks like it sets the animation only for next and prev and not moveToIdx.
Is there any way to change the duration and the type of the animation (like easing: "cubic-bezier(0.25, 0.1, 0.25, 1)") when swiping?
I managed to change the duration, but it only works when clicking on the navigation buttons, and not when swiping.
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
},
});
I tried changing dragSpeed, but looks like it works for a different purpose.
Here I modify the duration according to the docs. Also tried adding it to 'animationStarted'. Doesn't work:
If we take a look at the keen-slider source code and go to line 436 - (here's the Codepen by simulant144: https://codepen.io/simulant144/pen/WNqJvqz), there was a duration set to 500ms by default. If we change it to n.options.duration and now go to the line 825 and change this duration to let's say 5000ms it starts to work. Hope it helps to fix the issue. There should be an option just like in defaultAnimation: { duration }, but for swiping as well.
Looking for a possible solution.
The text was updated successfully, but these errors were encountered:
michaelprys
changed the title
Change animation duration and easing type for swiping
[Nuxt 3/ Vue 3]Change animation duration and easing type for swiping
Aug 22, 2024
michaelprys
changed the title
[Nuxt 3/ Vue 3]Change animation duration and easing type for swiping
[Nuxt 3/ Vue 3] Change animation duration and easing type for swiping
Aug 22, 2024
I posted this issue on nuxt-keen-slider github page modbender/nuxt-keen-slider#1, but I think it also makes sense to post it here, since it's related to the carousel options.
Reproduction: https://stackblitz.com/edit/nuxt-starter-wuvuih?file=app.vue
Issue:
In the documentation in says 'defaultAnimation sets the default animation of the functions moveToIdx, next and prev'. However, it looks like it sets the animation only for
next
andprev
and notmoveToIdx
.Is there any way to change the duration and the type of the animation (like easing: "cubic-bezier(0.25, 0.1, 0.25, 1)") when swiping?
I managed to change the duration, but it only works when clicking on the navigation buttons, and not when swiping.
I tried changing
dragSpeed
, but looks like it works for a different purpose.Here I modify the duration according to the docs. Also tried adding it to 'animationStarted'. Doesn't work:
If we take a look at the keen-slider source code and go to line
436
- (here's the Codepen by simulant144: https://codepen.io/simulant144/pen/WNqJvqz), there was a duration set to500ms
by default. If we change it ton.options.duration
and now go to the line825
and change this duration to let's say5000ms
it starts to work. Hope it helps to fix the issue. There should be an option just like indefaultAnimation: { duration }
, but for swiping as well.Looking for a possible solution.
The text was updated successfully, but these errors were encountered: