Update script.js
Browse files
script.js
CHANGED
@@ -23,21 +23,20 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
23 |
|
24 |
// ํค๋ณด๋ ์ด๋ฒคํธ
|
25 |
document.addEventListener('keydown', (e) => {
|
26 |
-
if (e.key === 'ArrowLeft') {
|
27 |
-
|
28 |
if (currentIndex > 0) {
|
29 |
-
//ํ์ฌ ์์น ๋นผ๊ธฐ 1
|
30 |
moveToSlide(currentIndex - 1);
|
31 |
}
|
32 |
-
} else if (e.key === 'ArrowRight') {
|
33 |
-
|
34 |
if (currentIndex < totalSlides - 1) {
|
35 |
-
//ํ์ฌ ์์น ๋ํ๊ธฐ 1
|
36 |
moveToSlide(currentIndex + 1);
|
37 |
}
|
38 |
}
|
39 |
});
|
40 |
|
|
|
41 |
// ํฐ์น ์ด๋ฒคํธ ์์
|
42 |
slider.addEventListener('touchstart', (e) => {
|
43 |
startTouchPosition = e.touches[0].clientX;
|
|
|
23 |
|
24 |
// ํค๋ณด๋ ์ด๋ฒคํธ
|
25 |
document.addEventListener('keydown', (e) => {
|
26 |
+
if (e.key === 'ArrowLeft' || e.key === 'a') {
|
27 |
+
// 'ArrowLeft', 'a', 'ใ
' ํค ์ฒ๋ฆฌ
|
28 |
if (currentIndex > 0) {
|
|
|
29 |
moveToSlide(currentIndex - 1);
|
30 |
}
|
31 |
+
} else if (e.key === 'ArrowRight' || e.key === 'd') {
|
32 |
+
// 'ArrowRight', 'd' ํค ์ฒ๋ฆฌ
|
33 |
if (currentIndex < totalSlides - 1) {
|
|
|
34 |
moveToSlide(currentIndex + 1);
|
35 |
}
|
36 |
}
|
37 |
});
|
38 |
|
39 |
+
|
40 |
// ํฐ์น ์ด๋ฒคํธ ์์
|
41 |
slider.addEventListener('touchstart', (e) => {
|
42 |
startTouchPosition = e.touches[0].clientX;
|