| 2110 | // ========================== |
| 2111 | |
| 2112 | function ScrollSpy(element, options) { |
| 2113 | this.$body = $(document.body) |
| 2114 | this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) |
| 2115 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) |
| 2116 | this.selector = (this.options.target || '') + ' .nav li > a' |
| 2117 | this.offsets = [] |
| 2118 | this.targets = [] |
| 2119 | this.activeTarget = null |
| 2120 | this.scrollHeight = 0 |
| 2121 | |
| 2122 | this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) |
| 2123 | this.refresh() |
| 2124 | this.process() |
| 2125 | } |
| 2126 | |
| 2127 | ScrollSpy.VERSION = '3.4.2' |
| 2128 | |