File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ class Demo extends React.Component {
4343 < p > Ant Motion</ p >
4444 </ div >
4545 < div className = "nav-wap" >
46- < Link className = "nav-list" location = "page0" offsetTop = { - 58 }
46+ < Link className = "nav-list" location = "page0"
4747 onFocus = { this . onFocus . bind ( this ) }
4848 >
4949 Example
5050 </ Link >
51- < Link className = "nav-list" location = "page1" offsetTop = { - 58 }
51+ < Link className = "nav-list" location = "page1" offsetTop = { 158 }
5252 onFocus = { this . onFocus . bind ( this ) }
5353 >
5454 Example2
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class ScrollLink extends React.Component {
4545 const elementDom = mapped . get ( this . props . location ) ;
4646 const elementRect = elementDom . getBoundingClientRect ( ) ;
4747 this . scrollTop = currentScrollTop ( ) ;
48- const toTop = Math . round ( elementRect . top ) - Math . round ( docRect . top ) + this . props . offsetTop ;
48+ const toTop = Math . round ( elementRect . top ) - Math . round ( docRect . top ) - this . props . offsetTop ;
4949 this . toTop = this . props . toShowHeight ?
5050 toTop - transformArguments ( this . props . showHeightActive ) [ 0 ] : toTop ;
5151 this . initTime = Date . now ( ) ;
You can’t perform that action at this time.
0 commit comments