The Roundabout scripting module is an optional but powerful tool to enhance the capabilities of Roundabout carousels. Methods are available for initiating scrolling, listening for scrolling, changing settings, and more.
To add the module to your project, it does not need to be linked to your HTML document. The RoundaboutScripter module is a static class that contains methods where (usually) the first parameter is the carousel to modify, and the second parameter is a callback function to execute.
Shown is an example of what your settings file might look like:
import RoundaboutScripter from "./roundabout-scripter.js";
import Roundabout from "./roundabout.js";
// Define carousels
const firstCarousel = new Roundabout({
// settings ...
});
const secondCarousel = new Roundabout({
// settings ...
});
// Use the scripter
RoundaboutScripter.onScroll(firstCarousel, () => {
// execute some code ...
});
RoundaboutScripter.onScrollNext(secondCarousel, () => {
// execute come code...
});
The module is included with the rest of the Roundabout download, but can be deleted if not needed.