forked from Gitlink/forgeplus-react
position
This commit is contained in:
parent
2129a222e5
commit
45fc4dcdcd
|
@ -44,11 +44,12 @@ export default ({
|
|||
useEffect(()=>{
|
||||
if(url && url.hash && html){
|
||||
let u = url.hash;
|
||||
debugger;
|
||||
if(u){
|
||||
let id = decodeURIComponent(u.split("#")[1]);
|
||||
let ele = document.getElementById(id);
|
||||
if(ele){
|
||||
window.scrollTo(0, ele.offsetTop - window.innerHeight / 5);
|
||||
window.scrollTo(0, ele.offsetTop + 220);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue