mirror of
https://github.com/Tooloop/Tooloop-Packages.git
synced 2026-04-27 12:31:38 +02:00
[Onboarding] add keyboard shortcuts
This commit is contained in:
@@ -77,6 +77,15 @@ class Slider {
|
||||
// observe scroll position
|
||||
this.element.onscroll = e => this.onScroll(e);
|
||||
|
||||
// keyboard shortcuts
|
||||
document.addEventListener("keydown", (e) => {
|
||||
e.preventDefault();
|
||||
});
|
||||
document.addEventListener("keyup", (e) => {
|
||||
if (e.code === "ArrowLeft") this.previous();
|
||||
if (e.code === "ArrowRight") this.next();
|
||||
});
|
||||
|
||||
// start auto play
|
||||
this.startTimeout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user