chohj06ms commited on
Commit
39a8714
โ€ข
1 Parent(s): 0ee0233

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +15 -0
script.js CHANGED
@@ -58,3 +58,18 @@ function handleTouchMove() {
58
  moveToSlide(currentIndex - 1);
59
  }
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  moveToSlide(currentIndex - 1);
59
  }
60
  }
61
+
62
+
63
+ // ๋งˆ์šฐ์Šค ํœ  ์ด๋ฒคํŠธ
64
+ slider.addEventListener('wheel', (e) => {
65
+ e.preventDefault(); // ํŽ˜์ด์ง€ ์Šคํฌ๋กค ๋ฐฉ์ง€
66
+
67
+ if (e.deltaY < 0 && currentIndex > 0) {
68
+ // ํœ ์„ ์œ„๋กœ ์Šคํฌ๋กค (์ด์ „ ์Šฌ๋ผ์ด๋“œ๋กœ ์ด๋™)
69
+ moveToSlide(currentIndex - 1);
70
+ } else if (e.deltaY > 0 && currentIndex < totalSlides - 1) {
71
+ // ํœ ์„ ์•„๋ž˜๋กœ ์Šคํฌ๋กค (๋‹ค์Œ ์Šฌ๋ผ์ด๋“œ๋กœ ์ด๋™)
72
+ moveToSlide(currentIndex + 1);
73
+ }
74
+ });
75
+