<ul class="tabs">
<li class="active"><a href="#">Home</a></li>
- <li class="dropdown" data-dropdown>
+ <li class="dropdown" data-dropdown="x" >
<a href="#" class="dropdown-toggle">Dropdown</a>
<ul class="dropdown-menu">
<li><a href="#">Secondary link</a></li>
@@ -303,20 +295,20 @@ $('#my-modal').bind('hidden', function () {
$('#topbar').dropdown()
Markup
To easily add scrollspy behavior to your nav, just add the data-scrollspy
attribute to the .topbar
.
-
<div class="topbar" data-scrollspy >...</div>
+ <div class="topbar" data-scrollspy="x" >...</div>
Methods
$().scrollspy()
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>
might correspond to a <div id="home"></div>
.
+
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>
.
.scrollspy('refresh')
- 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 like below.
+ 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')
Demo
- Look at the topbar navigation on this page.
+ Checkout the the topbar navigation on this page.