| 1886 | // ========================== |
| 1887 | |
| 1888 | function ScrollSpy(element, options) { |
| 1889 | this.$body = $(document.body) |
| 1890 | this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) |
| 1891 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) |
| 1892 | this.selector = (this.options.target || '') + ' .nav li > a' |
| 1893 | this.offsets = [] |
| 1894 | this.targets = [] |
| 1895 | this.activeTarget = null |
| 1896 | this.scrollHeight = 0 |
| 1897 | |
| 1898 | this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) |
| 1899 | this.refresh() |
| 1900 | this.process() |
| 1901 | } |
| 1902 | |
| 1903 | ScrollSpy.VERSION = '3.3.5' |
| 1904 | |