Update script.js
Browse files
script.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
let currentIndex =
|
2 |
let startTouchPosition = 0;
|
3 |
let endTouchPosition = 0;
|
4 |
|
@@ -11,6 +11,12 @@ function moveToSlide(n) {
|
|
11 |
currentIndex = n;
|
12 |
}
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
// ํค๋ณด๋ ์ด๋ฒคํธ
|
15 |
document.addEventListener('keydown', (e) => {
|
16 |
if (e.key === 'ArrowLeft') {
|
|
|
1 |
+
let currentIndex = 0;
|
2 |
let startTouchPosition = 0;
|
3 |
let endTouchPosition = 0;
|
4 |
|
|
|
11 |
currentIndex = n;
|
12 |
}
|
13 |
|
14 |
+
// ํ์ด์ง ๋ก๋ ์ ๋ ๋ฒ์งธ ์ฌ๋ผ์ด๋๋ก ์ด๋
|
15 |
+
document.addEventListener('DOMContentLoaded', () => {
|
16 |
+
moveToSlide(currentIndex); // ์ด๊ธฐ ์์น ์ค์
|
17 |
+
});
|
18 |
+
|
19 |
+
|
20 |
// ํค๋ณด๋ ์ด๋ฒคํธ
|
21 |
document.addEventListener('keydown', (e) => {
|
22 |
if (e.key === 'ArrowLeft') {
|