Splidejs / splide

Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.
https://splidejs.com
MIT License
4.9k stars 424 forks source link

override animation speed when moving to specific slide #456

Closed sahir-taib closed 3 years ago

sahir-taib commented 3 years ago

Checks

Version

v3.1.7

Description

In my case, i have a combination of multiple sliders synced together and the ui looks very similar to a table with main subject on first column of the table and contents are on the rest of the columns.

the first column is a vertical slider and the rest of columns are horizontal sliders wrapped within a vertical slider which is synced with the first one, so basically i have 2 vertical sliders synced together.

my concern is when i want to firstSlider.go(index) how can i disable speed option without updating the option like firstSlider.options = {speed: 0}?

for example, my current index is at 0 and i want to jump down to index 10, the animation makes my eyes itchy.

it would be great if i can pass an option in go() function with additional animation speed without changing default options being defined earlier

Reproduction Link

No response

Steps to Reproduce

  1. make 2 vertical sliders and make them sync together
  2. when current secondSlider.index is 0, call secondSlider.go(10) will move to the specific slide with animation speed defined in secondSlider.options

Expected Behaviour

when current secondSlider.index is 0, call secondSlider.go(10, {speed: 0}) for example to override default speed option

NaotoshiFujita commented 3 years ago

Close this for #458