ganlanyuan / tiny-slider

Vanilla javascript slider for all purposes.
MIT License
5.25k stars 785 forks source link

Add friction when dragging items all the way to the sides #364

Open laurens94 opened 5 years ago

laurens94 commented 5 years ago

When you get to the beginning or end of a slider, the dragging feels very dull because items can be dragged all the way to the edge.

I believe this is called freeDrag in OwlCarousel, but by default some kind of friction is added so dragging an item towards the edge becomes more difficult the further you drag it.

Can we achieve this as well in tiny-slider?

Thanks!

kobius commented 4 years ago

Can I bump this one?

This seems like a priority for sliders with looping set to false. I've been trying to de-construct OwlCarousel to understand how it handles friction when at the first or last item in the carousel, without any success yet.

Currently, it's easy to slide the entire slider off the screen - especially on desktop. Would be ideal to reduce the drag distance and drag speed when at first or last items.