1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-06 13:46:42 +02:00

allow scrollspy to target a specific nav

This commit is contained in:
Jacob Thornton
2011-11-25 17:30:52 -08:00
parent 98fddaa355
commit bd8745a98b
2 changed files with 4 additions and 4 deletions

View File

@@ -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()