I am making a slider that have 3 images and they are draggable with limits , I am using UI touch punch to make the mobile drag work.
This is my js code so far :
$(".draggable").draggable({
axis: "x",
drag: function(event, ui) {
//$(window).scrollTo(0, scrollPage);
//window.scrollBy(0,scrollPage);
if (ui.position.left > 0) {
newLeft = 0;
} else if (ui.position.left < max_drag) {
newLeft = max_drag;
} else {
newLeft = ui.position.left;
}
ui.position.left = newLeft;
}
});
and this is what i want to achieve :
now everything works except on mobile when i scroll vertically over the draggable element it doesn't scroll even tho the draggable is only on x axis.
I have searched and fuond this : jQuery UI draggable prevents scrolling on mobile And jQuery UI Draggable and Page Scrolling (on mobile) but I couldnt get a clear solution or answer.