Moveable
    Preparing search index...

    Interface ScrollableEvents

    interface ScrollableEvents {
        onScroll: OnScroll;
        onScrollGroup: OnScrollGroup;
    }
    Index
    onScroll: OnScroll

    When the drag cursor leaves the scrollContainer, the scroll event occur to scroll.

    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;
    });
    onScrollGroup: OnScrollGroup

    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;
    });