| 1900 | // ========================== |
| 1901 | |
| 1902 | function ScrollSpy(element, options) { |
| 1903 | this.$body = $(document.body) |
| 1904 | this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) |
| 1905 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) |
| 1906 | this.selector = (this.options.target || '') + ' .nav li > a' |
| 1907 | this.offsets = [] |
| 1908 | this.targets = [] |
| 1909 | this.activeTarget = null |
| 1910 | this.scrollHeight = 0 |
| 1911 | |
| 1912 | this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) |
| 1913 | this.refresh() |
| 1914 | this.process() |
| 1915 | } |
| 1916 | |
| 1917 | ScrollSpy.VERSION = '3.3.7' |
| 1918 | |