mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-28 20:52:21 +01:00
[Docs—Fixes #15882]Use an ID as the example for Scrollspy
Fixes #15882 — Use an ID as the example for Scrollspy so that it is more clear that this is for use with a single nav.
This commit is contained in:
parent
feda77f127
commit
ced312a90e
@ -75,9 +75,9 @@ body {
|
||||
}
|
||||
{% endhighlight %}
|
||||
{% highlight html %}
|
||||
<body data-spy="scroll" data-target=".navbar-example">
|
||||
<body data-spy="scroll" data-target="#navbar-example">
|
||||
...
|
||||
<div class="navbar-example">
|
||||
<div id="navbar-example">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
...
|
||||
</ul>
|
||||
@ -89,7 +89,7 @@ body {
|
||||
<h3>Via JavaScript</h3>
|
||||
<p>After adding <code>position: relative;</code> in your CSS, call the scrollspy via JavaScript:</p>
|
||||
{% highlight js %}
|
||||
$('body').scrollspy({ target: '.navbar-example' })
|
||||
$('body').scrollspy({ target: '#navbar-example' })
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user