desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Is there any ways to restrict the x value? #161

Closed forethoughtde closed 7 years ago

forethoughtde commented 7 years ago

I would like to know, if there are any ways to restrict x values. For example, I always the dragger to start at 20px left to the container and does not want to go below 20px.

I initialised the position of the draggable element like below but I want this setting to obey at all time and never should go below 20px in left.

$draggable.css({
        left: 86
    });
desandro commented 7 years ago

Thank you for this issue. Sorry, no there is no option to restrict dragging the slider in a direction. That's part of the feel of Flickity.