chohj06ms commited on
Commit
62c2791
โ€ข
1 Parent(s): dbd42f7

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +7 -1
script.js CHANGED
@@ -1,4 +1,4 @@
1
- let currentIndex = 1;
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') {