diff --git a/docs/javascript.html b/docs/javascript.html index ca4f941a15..f8ef930c6e 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -292,21 +292,21 @@ $('#my-modal').bind('hidden', function () {
$('#topbar').dropdown()+
$('#topbar').scrollSpy()
To easily add scrollspy behavior to your nav, just add the data-scrollspy
attribute to the .topbar
.
<div class="topbar" data-scrollspy="scrollspy" >...</div>
Auto activates navigation buttons by users scroll position.
$('body > .topbar').scrollSpy()
Notice Topbar anchor tags must have resolvable id targets. For example, a <a href="#home">home</a>
must correspond to something in the dom like <div id="home"></div>
.
The scrollspy caches nav buttons and section coordinates for performance. If you need to update this cache (likely if you have dynamic content) just call this refresh method. If you used the data attribute to define your scrollspy, just call refresh on the body.
-$('body').scrollspy('refresh')+
$('body').scrollSpy('refresh')
Checkout the the topbar navigation on this page.