strictEqual($scrollspy[0], $el[0], 'collection contains element')
})
- // Does not work properly ATM, #13500 will fix this
- test('should switch "active" class on scroll', function () {
- var topbarHTML = '<div class="topbar">'
- + '<div class="topbar-inner">'
- + '<div class="container">'
- + '<h3><a href="#">Bootstrap</a></h3>'
- + '<li><a href="#masthead">Overview</a></li>'
- + '</ul>'
- + '</div>'
- + '</div>'
- + '</div>'
- var $topbar = $(topbarHTML).bootstrapScrollspy()
-
- ok($topbar.find('.active', true))
- })
-
test('should only switch "active" class on current target', function () {
stop()
var $section = $(sectionHTML).appendTo('#qunit-fixture')
var $scrollspy = $section
- .show()
- .find('#scrollspy-example')
- .bootstrapScrollspy({ target: '#ss-target' })
+ .show()
+ .find('#scrollspy-example')
+ .bootstrapScrollspy({ target: '#ss-target' })
$scrollspy.on('scroll.bs.scrollspy', function () {
ok($section.hasClass('active'), '"active" class still on root node')
+ '</div>'
var $section = $(sectionHTML).appendTo('#qunit-fixture')
var $scrollspy = $section
- .show()
- .filter('#content')
+ .show()
+ .filter('#content')
$scrollspy.bootstrapScrollspy({ target: '#navigation', offset: $scrollspy.position().top })