JS > Mobile > Index > add a function to next-project button
All checks were successful
Deploy / Deploy to Production (push) Successful in 4s
All checks were successful
Deploy / Deploy to Production (push) Successful in 4s
This commit is contained in:
parent
5e478feed3
commit
4412a0a01a
1 changed files with 5 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
const nextButtons = document.querySelectorAll("button.next");
|
||||
const nextProjectButtons = document.querySelectorAll("button.next-project");
|
||||
|
||||
const projects = document.querySelectorAll(".projects-index .project");
|
||||
const firstProject = projects[0];
|
||||
|
|
@ -89,6 +90,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
nextButton.addEventListener("click", goToNextPicture);
|
||||
});
|
||||
|
||||
nextProjectButtons.forEach((nextProjectButton) => {
|
||||
nextProjectButton.addEventListener("click", goToNextProject);
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", (event) => {
|
||||
if (event.key === "ArrowRight") goToNextPicture();
|
||||
if (event.key === "ArrowLeft") goToPrevPicture();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue