mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
Conflicts: docs/less.html
This commit is contained in:
commit
e555f38ae4
@ -119,7 +119,7 @@ $(function(){
|
||||
// fix sub nav playa
|
||||
var $win = $(window)
|
||||
, $nav = $('.subnav')
|
||||
, navTop = $('.subnav').offset().top - 40
|
||||
, navTop = $('.subnav').length && $('.subnav').offset().top - 40
|
||||
, isFixed = 0
|
||||
|
||||
processScroll()
|
||||
|
13
js/bootstrap-scrollspy.js
vendored
13
js/bootstrap-scrollspy.js
vendored
@ -26,10 +26,11 @@
|
||||
|
||||
function ScrollSpy( element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
, $element = $(element).is('body') ? $(window) : $(element)
|
||||
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
||||
this.$scrollElement = $(element).on('scroll.scroll.data-api', process)
|
||||
this.selector = (this.$scrollElement.attr('data-target')
|
||||
|| this.$scrollElement.attr('href')
|
||||
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
|
||||
this.selector = (this.options.target
|
||||
|| $(element).attr('href')
|
||||
|| '') + ' .nav li > a'
|
||||
this.$body = $('body').on('click.scroll.data-api', this.selector, process)
|
||||
this.refresh()
|
||||
@ -111,11 +112,13 @@
|
||||
|
||||
|
||||
/* SCROLLSPY DATA-API
|
||||
* ============== */
|
||||
* ================== */
|
||||
|
||||
$(function () {
|
||||
var $spy = $('[data-spy="scroll"]')
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
var $spy = $(this)
|
||||
$spy.scrollspy($spy.data())
|
||||
})
|
||||
})
|
||||
|
||||
}( window.jQuery )
|
Loading…
x
Reference in New Issue
Block a user