bind arrows

This commit is contained in:
Zhora Shalyapin 2025-02-24 12:09:54 +00:00
parent 2e6e65862a
commit 039e80a55d

18
main.js
View File

@ -513,6 +513,24 @@
},
})
bindArrowForGallery('.swiper-button-prev', '.swiper-button-next')
}
function bindArrowForGallery(leftButtonQuery, rightButtonQuery) {
document.addEventListener("keydown", function(e) {
switch(e.key) {
case "ArrowLeft":
$(leftButtonQuery).click()
break
case "ArrowRight":
$(rightButtonQuery).click()
break
default: return
}
e.preventDefault()
})
}
function createSendButtons() {