File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ npm install scrollparent --save
1313``` js
1414var Scrollparent = require (" scrollparent" );
1515
16- Scrollparent (document .getElementById (" content" )) // document.body
16+ Scrollparent (document .getElementById (" content" )) // HTMLHtmlElement or HTMLBodyElement as appropriate
1717```
1818
1919``` js
Original file line number Diff line number Diff line change 4040 }
4141 }
4242
43- return document . body ;
43+ return document . scrollingElement || document . documentElement ;
4444 } ;
4545
4646 return scrollParent ;
Original file line number Diff line number Diff line change 127127
128128equal ( Scrollparent ( document . getElementById ( "test1" ) ) . className , "scroll" ) ;
129129
130- equal ( Scrollparent ( document . getElementById ( "test2" ) ) , document . body ) ;
131- equal ( Scrollparent ( document . getElementById ( "test3" ) ) , document . body ) ;
130+ equal ( Scrollparent ( document . getElementById ( "test2" ) ) , document . scrollingElement || document . documentElement ) ;
131+ equal ( Scrollparent ( document . getElementById ( "test3" ) ) , document . scrollingElement || document . documentElement ) ;
132132
133133equal ( Scrollparent ( document . getElementById ( "test4" ) ) . className , "scroll-y" ) ;
134134equal ( Scrollparent ( document . getElementById ( "test5" ) ) . className , "scroll-x" ) ;
You can’t perform that action at this time.
0 commit comments