File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 3333 speed : 400 ,
3434 vertical : false ,
3535 touch : true ,
36- wheelSpeed : 0
36+ wheelSpeed : 0 ,
37+ useMargin : false ,
38+ offset : 0
3739 }
3840 } ;
3941
169171 fire . trigger ( e , [ i , time ] ) ;
170172 if ( e . isDefaultPrevented ( ) || ! item . length ) { return self ; }
171173 }
172-
173- var props = vertical ? { top : - item . position ( ) . top } : { left : - item . position ( ) . left } ;
174+ var props ;
175+ if ( conf . useMargin ) {
176+ props = vertical ? { 'margin-top' : ( conf . offset - ( i * item . width ( ) ) ) } : { 'margin-left' : ( conf . offset - ( i * item . width ( ) ) ) } ;
177+ } else {
178+ props = vertical ? { top : ( conf . offset - item . position ( ) . top ) } : { left : ( conf . offset - item . position ( ) . left ) } ;
179+ }
174180
175181 index = i ;
176182 current = self ;
360366 $ ( this ) . data ( "scrollable" , el ) ;
361367 } ) ;
362368
369+
363370 return conf . api ? el : this ;
364371
365372 } ;
You can’t perform that action at this time.
0 commit comments