Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Avoid scrolling

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #176812
    mgk89
    Participant

    Hello,

    Is is possible to avoid scrolling to the top on a href=# link?

    My navigationbar uses href=# but I would like to keep the current scrolling position because there is no need to scroll to the top.

    thank you for your answer,

    mgk

    #176814
    Paulie_D
    Member

    How are you adding the scroll in the first place?

    We can’t diagnose code we can’t see. I would suggest you make a reduced case in Codepen.io.

    #176815
    mgk89
    Participant

    http://codepen.io/anon/pen/jBInJ

    the script changes the original structure of the links…

    #176821
    Senff
    Participant

    Just use:
    <a href="#" onclick="return false">Click!</a>

    #176830
    mgk89
    Participant

    indeed, it was that easy! thanks a lot!!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.