flickity icon indicating copy to clipboard operation
flickity copied to clipboard

Option for rubber-band strength when dragging past ends

Open ivancuric opened this issue 11 years ago • 6 comments

I couldn't find anything related to the rubber-band effect used in the slider, apart from the two friction variables - so much for me making the tweaks :)

Any chance of adding an option to edit the rubber-banding strength? I noticed that the current implementation is a linear one: for every 2 units the cursor moves, the slider moves by 1 unit across the entire duration of the overflow movement.

Consider making it an exponential function instead for a more native feeling.

ivancuric avatar Mar 19 '15 13:03 ivancuric

Thanks for reporting this request. Earlier in the development I had added lots of geometric logic so that the rubber band effect was 'more realistic.' In the end, it turned out to be a hundred lines of code. I felt the simpler 'half speed' solution was much more elegant, and produced nearly identical result.

I feel this is a minor detail feature, that doesn't require its own option. I'll leave this issue open to see other's interest.

desandro avatar Mar 19 '15 16:03 desandro

Is all the logic required in the same section? (dragging, line 3461). Where's the part that slows down the slider after flicking it over the edge?

ivancuric avatar Mar 20 '15 17:03 ivancuric

Here's the code: https://github.com/metafizzy/flickity/blob/v1.0.0/js/drag.js#L213-L219

desandro avatar Mar 20 '15 18:03 desandro

Is there a way to completely disable the rubber-band effect when flicking past the edge of a slide?

lisamayo avatar Mar 31 '15 19:03 lisamayo

@lisamayo Currently: no. But it could be controlled with this proposed option.

desandro avatar Apr 01 '15 00:04 desandro

Closing this feature request as its been quiet for a while :ghost:

desandro avatar Aug 31 '15 15:08 desandro