Skip to content

Working with Scroller

bapquad edited this page Feb 20, 2022 · 3 revisions

[Home] > Working with Scroller

This content we learn how work with a scroller in Element5JS API.

Makes scroll animation

element5js allow you create the scroller with an image.

let scroller = motion5.Scroll(200, 140, "nightcity.png");

Play the animation

After you had created the scroller, you would like to play the scroller.

// Create the play button
let playBtn = $.create("button").text("Play").on("click", () => {
  city.MotionScroll.Run(10);
});