From bd8745a98b93fb55e4c1c08a34e97bd30a16798c Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Fri, 25 Nov 2011 17:30:52 -0800 Subject: allow scrollspy to target a specific nav --- js/bootstrap-scrollspy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') 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() -- cgit v1.2.3