MCPcopy Create free account
hub / github.com/boostorg/build / ScrollSpy

Function ScrollSpy

website/bootstrap/js/bootstrap.js:1611–1628  ·  view source on GitHub ↗
(element, options)

Source from the content-addressed store, hash-verified

1609 // ==========================
1610
1611 function ScrollSpy(element, options) {
1612 var href
1613 var process = $.proxy(this.process, this)
1614
1615 this.$element = $(element).is('body') ? $(window) : $(element)
1616 this.$body = $('body')
1617 this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
1618 this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1619 this.selector = (this.options.target
1620 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1621 || '') + ' .nav li > a'
1622 this.offsets = $([])
1623 this.targets = $([])
1624 this.activeTarget = null
1625
1626 this.refresh()
1627 this.process()
1628 }
1629
1630 ScrollSpy.DEFAULTS = {
1631 offset: 10

Callers

nothing calls this directly

Calls 2

onMethod · 0.45
processMethod · 0.45

Tested by

no test coverage detected