File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ <h2>Contact Me</h2>
109109 < section >
110110 < h2 > Gallery</ h2 >
111111 < div class ="gallery-wrapper ">
112- < button class ="scroll-button left "> < </ button >
113- < div class ="gallery ">
112+ < button class ="scroll-button left " onclick =" scrollGallery(-1) " > < </ button >
113+ < div class ="gallery " id =" galleryContainer " >
114114 < div class ="gallery-item ">
115115 < img src ="./profile.jpg " height ="200px " width ="300px " />
116116 </ div >
@@ -148,11 +148,12 @@ <h2>Gallery</h2>
148148 < img src ="./suti.jpg " height ="200px " width ="300px " />
149149 </ div >
150150 </ div >
151- < button class ="scroll-button right "> > </ button >
151+ < button class ="scroll-button right " onclick =" scrollGallery(1) " > > </ button >
152152 </ div >
153153 </ section >
154154 < footer >
155155 < p > © 2025, Momi Foundation</ p >
156156 </ footer >
157+ < script src ="script.js "> </ script >
157158 </ body >
158159</ html >
Original file line number Diff line number Diff line change 1+
2+ function scrollGallery ( direction ) {
3+ const galleryContainer = document . getElementById ( 'galleryContainer' ) ;
4+ const scrollAmount = 320 ;
5+ galleryContainer . scrollLeft += direction * scrollAmount ;
6+ }
7+
8+ // can add auto-scroll in every 3 seconds
9+ setInterval ( ( ) => {
10+ scrollGallery ( 1 ) ;
11+ } , 3000 ) ;
You can’t perform that action at this time.
0 commit comments