I am using Greensock Draggable, to build a draggable slider control. for example, let's say I have a 3 pages slider, when the position is scrolled to 1/3, turns to the second page.
let myDraggable = new Draggable(dragger, {
//trigger:ufo,
type:'x',
bounds:{minX:0, maxX:maxDrag},
throwProps:true,
//cursor:'auto',
/* liveSnap:function(value){
return Math.round(value / step) * step;
}, */
onPress:onPress,
onRelease:onRelease,
onThrowComplete:function(){isDragging = false},
overshootTolerance:0
})
everything works fine so far, by defining onRelease function, I built the functionality completely.
but then I want to build auto-scrolling, not the one mentioned in documentation, but, use setInterval to gradually scroll to 1/3, 2/3... but draggable does not seem to support customise x position dragging, which I failed to look up for a function that takes x position and drag the element there.
is there a draggable api that takes one position and drags the element there? if it doesn't, do I have to build a untrusted drag event? if so how can I do that?
sorry that I did a lot relative research but failed to work out solution. I will be more than glad if you can give me a hand, or just something to read for another direction.