File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
demos/react-managed-form-custom Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 7070 function lockBodyScroll ( lock ) {
7171 var tag = document . querySelector ( '.container' ) ; // the child element of body that contains the long content
7272 if ( ! tag ) return ;
73- if ( ! document . scrollingElement ) {
74- alert ( 'Please use newer browser!' , document . body . scrollTop ) ;
75- return ;
76- }
73+ var elem = document . scrollingElement || document . body ;
7774 if ( ! tag . classList ) {
7875 alert ( 'Use newer browser!' ) ;
7976 return ;
8077 }
8178 if ( lock ) {
82- var scrollTop = document . scrollingElement . scrollTop ;
79+ var scrollTop = elem . scrollTop ;
8380 tag . classList . add ( 'no-scroll' ) ;
8481 tag . style . top = '-' + scrollTop + 'px' ;
8582 } else {
8683 var top = tag . offsetTop ;
8784 tag . classList . remove ( 'no-scroll' ) ;
8885 tag . style . top = '0px' ;
89- document . scrollingElement . scrollTop = - top ;
86+ elem . scrollTop = - top ;
9087 }
9188 }
9289 </ script >
You can’t perform that action at this time.
0 commit comments