When clicking on the site / # service link, an auto scrolling of the site arises depending on the height of the link, if site / # = service, there is no scrolling.

The question is, is it possible to disable auto scrolling when clicking on the site / # service link?

    1 answer 1

    In html such links are called anchors .
    In javascript, the part of the link after the # hash sign is called hash and is accessible through the hash property

    To disable scrolling, simply add this code to the page:

     if (window.location.hash) { setTimeout(function(){ window.scrollTo(0, 0); }, 1); }