Why do page anchors sometimes miss?

后端 未结 7 1564
灰色年华
灰色年华 2020-12-15 05:41

On an HTML page, a link like this:

Location on Page

...should navigate to this spot on the

7条回答
  •  北海茫月
    2020-12-15 06:39

    I believe the behavior you are seeing is the result of the browser locating to that spot on the page before all images have finished loading. Once the images finish loading, then the layout of the page has changed (the page is likely longer vertically, for example), causing the location of where the anchor should be to have changed - but the browser still thinks it has already navigated to that anchor.

提交回复
热议问题