Commit bd8745a9 authored by Jacob Thornton's avatar Jacob Thornton
Browse files

allow scrollspy to target a specific nav

parent 98fddaa3
20 merge requests!14752.0 wip,!1403warningText and warningBackground docs fix,!985Fix id anchor javascript,!906Twipsy now respects custom classes,!873Clicking a dropdown will always toggle it,!858Bordered Arrow Mixin - updated for 2.0,!832Fix thumbnails in Built With Bootstrap,!13512.0 wip - relative font sizes,!1315[2.0-wip] Fix mustache glob when building,!1268[wip-2.0] IE 7/8 Typehead JS fix,!12362.0 wip - Fix for issue #1202,!1219Removed dotted outline on navbar dropdown menu,!1210Missing icon class from examples,!1195Fixed display of secondary container,!1090Fixed typo,!1084Default `.border-radius-custom` values,!1064Typo Fix in tables.less,!10572.0 wip,!1052Missing data attribute to close modal,!10212.0 wip
Showing with 4 additions and 4 deletions
+4 -4
......@@ -380,7 +380,7 @@ $('#myModal').bind('hidden', function () {
Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!</p>
<p>
<div id="navbar-example" class="navbar navbar-static">
<div id="navbarExample" class="navbar navbar-static">
<div class="navbar-inner">
<div class="container" style="width: auto;">
<a class="brand" href="#">Project Name</a>
......@@ -401,7 +401,7 @@ $('#myModal').bind('hidden', function () {
</div>
</div>
<div data-spy="scroll" class="scrollspy-example">
<div data-spy="scroll" data-target="#navbarExample" class="scrollspy-example">
<h4 id="fat">@fat</h4>
<p>
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
......
......@@ -26,10 +26,10 @@
function ScrollSpy( element ) {
var process = $.proxy(this.process, this)
this.selector = '.nav li > a'
this.$body = $('body').delegate(this.selector, 'click.scroll.data-api', process)
this.$scrollElement = $(element).bind('scroll.scroll.data-api', process)
this.selector = (this.$scrollElement.attr('data-target') || '') + ' .nav li > a'
this.$body = $('body').delegate(this.selector, 'click.scroll.data-api', process)
this.refresh()
this.process()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment