Created
March 2, 2022 10:43
-
-
Save daybrush/a0366273890f43f8588c127536404143 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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