mirror of
https://github.com/twbs/bootstrap.git
synced 2025-05-28 00:04:05 -04:00
no need to check for href attribute on the scrollable element
This commit is contained in:
parent
0be4109688
commit
632313d631
@ -14,16 +14,13 @@
|
|||||||
// ==========================
|
// ==========================
|
||||||
|
|
||||||
function ScrollSpy(element, options) {
|
function ScrollSpy(element, options) {
|
||||||
var href
|
|
||||||
var process = $.proxy(this.process, this)
|
var process = $.proxy(this.process, this)
|
||||||
|
|
||||||
this.$element = $(element).is('body') ? $(window) : $(element)
|
this.$element = $(element).is('body') ? $(window) : $(element)
|
||||||
this.$body = $('body')
|
this.$body = $('body')
|
||||||
this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
|
this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
|
||||||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||||
this.selector = (this.options.target
|
this.selector = (this.options.target || '') + ' .nav li > a'
|
||||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
|
||||||
|| '') + ' .nav li > a'
|
|
||||||
this.offsets = []
|
this.offsets = []
|
||||||
this.targets = []
|
this.targets = []
|
||||||
this.activeTarget = null
|
this.activeTarget = null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user