Skip to content
Snippets Groups Projects

Prevent anchors from being hidden by header upon a new page load

Merged Stan Hu requested to merge stanhu/gitlab-ce:fix-headers-blocking-anchors into master

Browsers change the scroll position after the page is loaded, and the current 1 ms delay wasn't long enough for the browser to jump to the anchor. Even then, it appears another 100ms delay is necessary to adjust the scroll properly:

http://stackoverflow.com/questions/19057731/scrolltop-on-page-reload-doesnt-work-possible-script-conflict

Add a little more of an offset to see a few lines before the anchor.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading