diff options
| author | Mark Otto <[email protected]> | 2013-11-29 20:25:07 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-11-29 20:25:07 -0800 |
| commit | 7d456aef76e0e9353269feb71aef8b7ae61f2c1d (patch) | |
| tree | 2129a6b4f70549014f5c3b50adb2b2af85b42abc | |
| parent | a4c54b5e5d948e9ec7cdd22bc0efa2241d2605c6 (diff) | |
| download | bootstrap-7d456aef76e0e9353269feb71aef8b7ae61f2c1d.tar.xz bootstrap-7d456aef76e0e9353269feb71aef8b7ae61f2c1d.zip | |
Update scrollspy docs to more clearly indicate usage
| -rw-r--r-- | javascript.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/javascript.html b/javascript.html index a6c3344f8..9b808c364 100644 --- a/javascript.html +++ b/javascript.html @@ -529,6 +529,7 @@ $('#myDropdown').on('show.bs.dropdown', function () { {% endhighlight %} </div> + <!-- ScrollSpy ================================================== --> <div class="bs-docs-section"> @@ -588,7 +589,13 @@ $('#myDropdown').on('show.bs.dropdown', function () { <h3>Via data attributes</h3> <p>To easily add scrollspy behavior to your topbar navigation, add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the <code><body></code>). Then add the <code>data-target</code> attribute with the ID or class of the parent element of any Bootstrap <code>.nav</code> component.</p> {% highlight html %} -<body data-spy="scroll" data-target="#navbar-example"> +<body data-spy="scroll" data-target=".navbar-example"> + ... + <div class="navbar-example"> + <ul class="nav nav-tabs"> + ... + </ul> + </div> ... </body> {% endhighlight %} @@ -596,7 +603,7 @@ $('#myDropdown').on('show.bs.dropdown', function () { <h3>Via JavaScript</h3> <p>Call the scrollspy via JavaScript:</p> {% highlight js %} -$('body').scrollspy({ target: '#navbar-example' }) +$('body').scrollspy({ target: '.navbar-example' }) {% endhighlight %} <div class="bs-callout bs-callout-danger"> |
