I’m trying to use Bootstrap and I’m having some trouble implementing the page navigation.
The navigation links looks like this:
<a href="#Profile">Profile</a>
This would change the browser URL to append #Profile. Running fiddler it seems it doesn’t cause the page to refresh (no traffic is passed).
This doesn’t seem to be documented in the Bootstrap documentation and since I don’t even know the name of the feature I haven’t managed to look up how to implement it properly. Can anyone tell me what its called and possibly provide an explanation or some documentation?
As requested:
A link prefaced with # triggers a
hashChangeevent, and scrolls the current page to an element with anidequal to Profile (so:<div id="Profile>...</div>). This isn’t a twitter-bootstrap feature, it’s purely HTML.Note that this is true of a link as posted in your question:
<a href="#Profile">Profile</a>Should the link’s
hrefhave the form:<a href="http://example.com/index.html#Profile">Profile</a>then it will load a new page, and immediately scroll to the element of
id="Profile". This is useful for linking to specific portions of other pages (my own predominant use-case for this is to link to specific portions of Quirksmode’s compatibility, or the W3’s, HTML/CSS docs).