File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 9999 marginTop : self . sTop ,
100100 right : ( self . options . float == 'right' ? '0px' : '' ) ,
101101 transition : 'opacity .5s' ,
102- cursor : 'default'
102+ cursor : 'default' ,
103+ opacity :0
103104 } ,
104105 attrs : {
105106 id : self . id2
151152 this . height = Math . max ( this . scrollHeight / ( this . scrollInnerHeight / this . scrollHeight ) , this . minBarHeight ) ;
152153 //计算滚动条每次滚动的距离innerdeltaY
153154 this . innerdeltaY = ( this . scrollHeight - this . height ) / scrollTime ;
154- if ( this . scrollHeight < this . scrollInnerHeight ) {
155155 //调整top的值
156156 this . resizeTop ( ) ;
157157 this . showBar ( ) ;
158- }
159158 } ,
160159 resizeTop : function ( ) {
161160 //先求出con剩余的值
164163 this . top = this . scrollHeight - ( this . height + ( time * this . innerdeltaY ) ) ;
165164 } ,
166165 showBar : function ( ) {
167- var bar = document . getElementById ( this . id2 ) ;
168- bar . style . opacity = 1 ;
166+ if ( this . scrollHeight < this . scrollInnerHeight ) {
167+ var bar = document . getElementById ( this . id2 ) ;
168+ bar . style . opacity = 1 ;
169+ }
169170 } ,
170171 hideBar : function ( ) {
171172 if ( ! this . mousedown ) {
You can’t perform that action at this time.
0 commit comments