Skip to content

Commit

Permalink
Merge pull request #2025 from ViktorErmakov/develop
Browse files Browse the repository at this point in the history
Добавил возможность прокрутки стрелками клавиатуры Карусель 3Д
  • Loading branch information
Pr-Mex authored Aug 5, 2023
2 parents 33e0eb4 + 148ec10 commit a2f404e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions VanessaAutomation/Templates/CSS_3D_Сarousel/Ext/Template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,24 @@
rotateCarousel(currImage);

});

// Прокрутка слайдов стрелками клавиатуры
document.addEventListener('keydown', (event) => {
const key = event.key; // "ArrowRight", "ArrowLeft", "ArrowUp", or "ArrowDown"
switch (key) {
case "ArrowLeft":
if (currImage !== 0) {
currImage--;
}
break;
case "ArrowRight":
if (currImage !== n - 1) {
currImage++;
}
break;
}
rotateCarousel(currImage);
});

// пролистывание слайдов при клике в оглавлении
let contents_a = document.querySelectorAll('.toc_ol a');
Expand Down

0 comments on commit a2f404e

Please sign in to comment.