File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11121112
11131113 // Returns the width of the vertical scrollbar
11141114 $ . ig . util . getScrollWidth = function ( ) {
1115- var el = $ ( '<div style="width: 100px; height: 100px; position: absolute; ' +
1116- 'top: -10000px; left: -10000px; overflow: scroll"></div>' )
1117- . appendTo ( $ ( document . body ) ) , scrollWidth ;
1115+ var el = $ ( "<div></div>" ) . appendTo ( $ ( document . body ) ) , scrollWidth ;
1116+ el . css ( {
1117+ "width" : "100px" ,
1118+ "height" : "100px" ,
1119+ "position" : "absolute" ,
1120+ "top" : "-10000px" ,
1121+ "left" : "-10000px" ,
1122+ "overflow" : "scroll"
1123+ } ) ;
11181124 scrollWidth = el [ 0 ] . offsetWidth - el [ 0 ] . clientWidth ;
11191125 el . remove ( ) ;
11201126 return scrollWidth ;
11211127 } ;
11221128
11231129 // Returns the height of the horizontal scrollbar
11241130 $ . ig . util . getScrollHeight = function ( ) {
1125- var el = $ ( '<div style="width: 100px; height: 100px; position: absolute; ' +
1126- 'top: -10000px; left: -10000px; overflow: scroll"></div>' )
1127- . appendTo ( $ ( document . body ) ) , scrollHeight ;
1131+ var el = $ ( "<div></div>" ) . appendTo ( $ ( document . body ) ) , scrollHeight ;
1132+ el . css ( {
1133+ "width" : "100px" ,
1134+ "height" : "100px" ,
1135+ "position" : "absolute" ,
1136+ "top" : "-10000px" ,
1137+ "left" : "-10000px" ,
1138+ "overflow" : "scroll"
1139+ } ) ;
11281140 scrollHeight = el [ 0 ] . offsetHeight - el [ 0 ] . clientHeight ;
11291141 el . remove ( ) ;
11301142 return scrollHeight ;
You can’t perform that action at this time.
0 commit comments