allow scrollspy to target a specific nav
This commit is contained in:
parent
98fddaa355
commit
bd8745a98b
2 changed files with 4 additions and 4 deletions
4
js/bootstrap-scrollspy.js
vendored
4
js/bootstrap-scrollspy.js
vendored
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue