Jump to content
horst

JS: Catch browsers #anchor jumps on load, before they scroll to position

Recommended Posts

When I load a site per link with URL & anchor (https://www.example.com/#anchor), is it possible to catch / prevent the native jump and instead delegate this to an own javascript?

I found many resources about smoothscrolling within a doc, but I need to know if there is an event that can be catched, before a browser does a native anchor jump. :)

 

Share this post


Link to post
Share on other sites

You could try one of the suggestions from here.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
27 minutes ago, dragan said:

You could try one of the suggestions from here.

This looks good! Will try it in the afternoon. Many thanks. 👍

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...