| 1547 | * ========================== */ |
| 1548 | |
| 1549 | function ScrollSpy(element, options) { |
| 1550 | var process = $.proxy(this.process, this) |
| 1551 | , $element = $(element).is('body') ? $(window) : $(element) |
| 1552 | , href |
| 1553 | this.options = $.extend({}, $.fn.scrollspy.defaults, options) |
| 1554 | this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process) |
| 1555 | this.selector = (this.options.target |
| 1556 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
| 1557 | || '') + ' .nav li > a' |
| 1558 | this.$body = $('body') |
| 1559 | this.refresh() |
| 1560 | this.process() |
| 1561 | } |
| 1562 | |
| 1563 | ScrollSpy.prototype = { |
| 1564 | |