All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.animations.scroll.js Maven / Gradle / Ivy

import animate, { duration } from "./animate.js";
const scroll = (element, dx, dy) => {
    let scrollLeft;
    let scrollTop;
    return animate({
        beforeStart: () => {
            scrollLeft = element.scrollLeft;
            scrollTop = element.scrollTop;
        },
        duration,
        element,
        advance: progress => {
            element.scrollLeft = scrollLeft + (progress * dx); // easing - linear
            element.scrollTop = scrollTop + (progress * dy); // easing - linear
        },
    });
};
export default scroll;
//# sourceMappingURL=scroll.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy