File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1515 < li class ="slider-item "> < img src ="images/pic23.gif " alt ="3 "> </ li >
1616 < li class ="slider-item "> < img src ="images/pic24.gif " alt ="4 "> </ li >
1717 </ ul >
18- < div class ="slider-button prev "> <</ div >
19- < div class ="slider-button next "> ></ div >
2018 </ div >
2119 < script >
22- Slider ( '#slider' )
20+ Slider ( '#slider' , {
21+ buttons :true
22+ } )
2323 </ script >
2424</ body >
2525</ html >
Original file line number Diff line number Diff line change 2727 autoplay : true ,
2828 bounceRatio :0.1 ,
2929 pagination :true ,
30+ loop :true ,
31+ buttons :false ,
3032 paginationClass :'slider-pagination' ,
3133 bulletClass :'slider-bullet' ,
32- bulletActiveClass :'slider-bullet-active' ,
33- loop :true
34+ bulletActiveClass :'slider-bullet-active'
3435 } ;
3536
3637 var isObject = function ( obj ) {
123124 this . createLoopItems ( ) ;
124125 }
125126
127+ if ( this . params . buttons ) {
128+ this . createButtons ( ) ;
129+ }
130+
126131 if ( this . params . autoplay ) {
127132 this . autoPlay ( ) ;
128133 }
184189 this . setActivePagination ( ) ;
185190 }
186191
192+ fn . createButtons = function ( ) {
193+ var prev = document . createElement ( 'div' ) ;
194+ var next = document . createElement ( 'div' ) ;
195+ prev . className = 'slider-button prev' ;
196+ next . className = 'slider-button next' ;
197+ prev . innerHTML = '<' ;
198+ next . innerHTML = '>' ;
199+ this . container . appendChild ( prev ) ;
200+ this . container . appendChild ( next ) ;
201+ }
202+
187203 fn . setActivePagination = function ( ) {
188204 var prevIndex = this . activeBulletIndex ;
189205 var activeIndex = this . activeIndex ;
You can’t perform that action at this time.
0 commit comments