mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
parent
b50d4a176f
commit
6d882a6420
@ -33,41 +33,40 @@ $(function () {
|
|||||||
ok($topbar.find('.active', true))
|
ok($topbar.find('.active', true))
|
||||||
})
|
})
|
||||||
|
|
||||||
test("should only switch active class on current target", function () {
|
test('should only switch active class on current target', function () {
|
||||||
var
|
var sectionHTML = '<div id="root" class="active">' +
|
||||||
sectionHTML = '<div id="root" class="active">'
|
'<div class="topbar">' +
|
||||||
+ '<div class="topbar">'
|
'<div class="topbar-inner">' +
|
||||||
+ '<div class="topbar-inner">'
|
'<div class="container" id="ss-target">' +
|
||||||
+ '<div class="container" id="ss-target">'
|
'<ul class="nav">' +
|
||||||
+ '<ul class="nav">'
|
'<li><a href="#masthead">Overview</a></li>' +
|
||||||
+ '<li><a href="#masthead">Overview</a></li>'
|
'<li><a href="#detail">Detail</a></li>' +
|
||||||
+ '<li><a href="#detail">Detail</a></li>'
|
'</ul>' +
|
||||||
+ '</ul>'
|
'</div>' +
|
||||||
+ '</div>'
|
'</div>' +
|
||||||
+ '</div>'
|
'</div>' +
|
||||||
+ '</div>'
|
'<div id="scrollspy-example" style="height: 100px; overflow: auto;">' +
|
||||||
+ '<div id="scrollspy-example" style="height: 100px; overflow: auto;">'
|
'<div style="height: 200px;">' +
|
||||||
+ '<div style="height: 200px;">'
|
'<h4 id="masthead">Overview</h4>' +
|
||||||
+ '<h4 id="masthead">Overview</h4>'
|
'<p style="height: 200px">' +
|
||||||
+ '<p style="height: 200px">'
|
'Ad leggings keytar, brunch id art party dolor labore.' +
|
||||||
+ 'Ad leggings keytar, brunch id art party dolor labore.'
|
'</p>' +
|
||||||
+ '</p>'
|
'</div>' +
|
||||||
+ '</div>'
|
'<div style="height: 200px;">' +
|
||||||
+ '<div style="height: 200px;">'
|
'<h4 id="detail">Detail</h4>' +
|
||||||
+ '<h4 id="detail">Detail</h4>'
|
'<p style="height: 200px">' +
|
||||||
+ '<p style="height: 200px">'
|
'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.' +
|
||||||
+ 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.'
|
'</p>' +
|
||||||
+ '</p>'
|
'</div>' +
|
||||||
+ '</div>'
|
'</div>' +
|
||||||
+ '</div>'
|
'</div>',
|
||||||
+ '</div>'
|
$section = $(sectionHTML).appendTo('#qunit-fixture'),
|
||||||
, $section = $(sectionHTML).appendTo("#qunit-fixture")
|
$scrollSpy = $section
|
||||||
, $scrollSpy = $section
|
.show()
|
||||||
.show()
|
.find('#scrollspy-example')
|
||||||
.find("#scrollspy-example")
|
.scrollspy({target: '#ss-target'})
|
||||||
.scrollspy({target: "#ss-target"})
|
|
||||||
|
|
||||||
$scrollSpy.scrollTop(350);
|
$scrollSpy.scrollTop(350);
|
||||||
ok($section.hasClass("active"), "Active class still on root node")
|
ok($section.hasClass('active'), 'Active class still on root node')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user