import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
target: document.querySelector(".target"),
});
moveable.on("scroll", ({ scrollContainer, direction }) => {
scrollContainer.scrollLeft += direction[0] * 10;
scrollContainer.scrollTop += direction[1] * 10;
});
When the drag cursor leaves the scrollContainer, the scrollGroup event occur to scroll in group.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
});
moveable.on("scroll", ({ scrollContainer, direction }) => {
scrollContainer.scrollLeft += direction[0] * 10;
scrollContainer.scrollTop += direction[1] * 10;
});
When the drag cursor leaves the scrollContainer, the
scrollevent occur to scroll.