Hello, I have this draggable feature on my slider but I also want previous and next controls to it so I added basic gsap.to() to the buttons which translates the slider to wanted direction but it goes over the boundaries I have set in the Draggable config object. My question: is there a way to connect the prev/next controls to the Draggable boundaries so that the slider doesn't go past them and if not is there a way to set the boundaries some other way?
Here's my draggable object:
var draggable = new Draggable('#slides-inner', {
trigger: '.slides-container',
type:"x",
bounds: {
minX:0,
maxX: -wrapWidth + windowWidth + 20
},
inertia: true,
});
And here's the prev/next animation:
function animateSlides(direction) {
var x = direction * slideWidth;
gsap.to('#slides-inner', {
x: x,
ease: 'Power3.easeInOut'
})
}