From: Mark Otto Date: Sat, 30 Nov 2013 04:25:07 +0000 (-0800) Subject: Update scrollspy docs to more clearly indicate usage X-Git-Tag: v3.0.3~16^2~7^2^2~2^2~2^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d456aef76e0e9353269feb71aef8b7ae61f2c1d;p=thirdparty%2Fbootstrap.git Update scrollspy docs to more clearly indicate usage --- diff --git a/javascript.html b/javascript.html index a6c3344f8f..9b808c3649 100644 --- a/javascript.html +++ b/javascript.html @@ -529,6 +529,7 @@ $('#myDropdown').on('show.bs.dropdown', function () { {% endhighlight %} +
@@ -588,7 +589,13 @@ $('#myDropdown').on('show.bs.dropdown', function () {

Via data attributes

To easily add scrollspy behavior to your topbar navigation, add data-spy="scroll" to the element you want to spy on (most typically this would be the <body>). Then add the data-target attribute with the ID or class of the parent element of any Bootstrap .nav component.

{% highlight html %} - + + ... + ... {% endhighlight %} @@ -596,7 +603,7 @@ $('#myDropdown').on('show.bs.dropdown', function () {

Via JavaScript

Call the scrollspy via JavaScript:

{% highlight js %} -$('body').scrollspy({ target: '#navbar-example' }) +$('body').scrollspy({ target: '.navbar-example' }) {% endhighlight %}