I need to hide anchor on my url.
<a href="#book">Book</a>
This anchor is attached on jquery smooth scroll, when i click my url become:
www.test.it/#book
I don’t want #book on my url.
is possibile?
And is possibile hide from another page?
example: www.test.it/#book to www.test.it
I see this thing on boostrap modal.
Can see here, on my site: http://www.alessandrapinto.it/
2
Answers
You will need to add this:
To the end of your jQuery function.
and then you will not see the #something in the URL.
For example, clicked anchors will not take the browser to a new URL. We can use event.isDefaultPrevented() to determine if this method has been called by an event handler that was triggered by this event.
if there is # in url it will update URL by default. You need to do this with jquery if you don’t want to add # in URL. Add Id your anchor I am taking this as id=”name” then add class to your div till where you want to scroll your page I am taking this like class=”name”
DEMO