File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 32
32
function Antiscroll ( el , opts ) {
33
33
this . el = $ ( el ) ;
34
34
this . options = opts || { } ;
35
+
36
+ this . x = false !== this . options . x ;
37
+ this . y = false !== this . options . y ;
35
38
this . padding = undefined == this . options . padding ? 2 : this . options . padding ;
39
+
36
40
this . inner = this . el . find ( '.antiscroll-inner' ) ;
37
41
this . inner . css ( {
38
42
'width' : '+=' + scrollbarSize ( )
51
55
var needHScroll = this . inner . get ( 0 ) . scrollWidth > this . el . width ( )
52
56
, needVScroll = this . inner . get ( 0 ) . scrollHeight > this . el . height ( ) ;
53
57
54
- if ( ! this . horizontal && needHScroll ) {
58
+ if ( ! this . horizontal && needHScroll && this . x ) {
55
59
this . horizontal = new Scrollbar . Horizontal ( this ) ;
56
60
} else if ( this . horizontal && ! needHScroll ) {
57
61
this . horizontal . destroy ( ) ;
58
62
this . horizontal = null
59
63
}
60
64
61
- if ( ! this . vertical && needVScroll ) {
65
+ if ( ! this . vertical && needVScroll && this . y ) {
62
66
this . vertical = new Scrollbar . Vertical ( this ) ;
63
67
} else if ( this . vertical && ! needVScroll ) {
64
68
this . vertical . destroy ( ) ;
You can’t perform that action at this time.
0 commit comments