File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
project6-ImageCarousel/src Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,13 @@ export default function App({ $target }) {
4949 curdot . className += ' active' ;
5050 } ;
5151
52- // slide가 렌더되기 전에 showSlides()가 실행되는 문제가 있어서
53- // wep API를 이용해 slide 렌더 이후에 showSlides()를 처리할 수 있게끔 함
54- setTimeout ( ( ) => showSlides ( slideIndex ) , 0 ) ;
52+ this . init = ( ) => {
53+ // slide가 렌더되기 전에 showSlides()가 실행되는 문제가 있어서
54+ // wep API를 이용해 slide 렌더 이후에 showSlides()를 처리할 수 있게끔 함
55+ setTimeout ( ( ) => showSlides ( slideIndex ) , 0 ) ;
56+ } ;
57+
58+ this . init ( ) ;
5559
5660 new Controller ( { $target : $slideContainer , onClick : ( n ) => showSlides ( ( slideIndex += n ) ) } ) ;
5761}
Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ export default function Project6Page({ $target }) {
55
66 $page . className = 'project6 page' ;
77
8- new App ( { $target : $page } ) ;
8+ const app = new App ( { $target : $page } ) ;
99
1010 this . render = ( ) => {
1111 $target . append ( $page ) ;
12+ app . init ( ) ;
1213 } ;
1314}
You can’t perform that action at this time.
0 commit comments