Skip to content

Instantly share code, notes, and snippets.

@daybrush
Created March 2, 2022 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daybrush/a0366273890f43f8588c127536404143 to your computer and use it in GitHub Desktop.
Save daybrush/a0366273890f43f8588c127536404143 to your computer and use it in GitHub Desktop.
import Conveyer from "@egjs/conveyer";
const conveyer = new Conveyer(".items");
const prev = document.querySelector(".prev");
const next = document.querySelector(".next");
prev.addEventListener("click", () => {
// start to end
conveyer.scrollIntoView("start", {
align: "end",
duration: 500,
excludeStand: true,
});
});
next.addEventListener("click", () => {
// end to start
conveyer.scrollIntoView("end", {
align: "start",
duration: 500,
excludeStand: true,
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment