aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-11-25 17:30:52 -0800
committerJacob Thornton <[email protected]>2011-11-25 17:30:52 -0800
commitbd8745a98b93fb55e4c1c08a34e97bd30a16798c (patch)
treeb173d55f30d5c8d60018fe6f2eb28380a1928459 /js
parent98fddaa3557b1c872f1e585d579ec7e5e989e95d (diff)
downloadbootstrap-bd8745a98b93fb55e4c1c08a34e97bd30a16798c.tar.xz
bootstrap-bd8745a98b93fb55e4c1c08a34e97bd30a16798c.zip
allow scrollspy to target a specific nav
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-scrollspy.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js
index ac9477d0e..e4bfea483 100644
--- a/js/bootstrap-scrollspy.js
+++ b/js/bootstrap-scrollspy.js
@@ -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()