Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

final procedural project

ER authored on 13/04/2012 10:17:34
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,31 @@
1
+$(function () {
2
+
3
+    module("bootstrap-scrollspy")
4
+
5
+      test("should be defined on jquery object", function () {
6
+        ok($(document.body).scrollspy, 'scrollspy method is defined')
7
+      })
8
+
9
+      test("should return element", function () {
10
+        ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
11
+      })
12
+
13
+      test("should switch active class on scroll", function () {
14
+        var sectionHTML = '<div id="masthead"></div>'
15
+          , $section = $(sectionHTML).append('#qunit-runoff')
16
+          , topbarHTML ='<div class="topbar">'
17
+          + '<div class="topbar-inner">'
18
+          + '<div class="container">'
19
+          + '<h3><a href="#">Bootstrap</a></h3>'
20
+          + '<ul class="nav">'
21
+          + '<li><a href="#masthead">Overview</a></li>'
22
+          + '</ul>'
23
+          + '</div>'
24
+          + '</div>'
25
+          + '</div>'
26
+          , $topbar = $(topbarHTML).topbar()
27
+
28
+        ok(topbar.find('.active', true)
29
+      })
30
+
31
+})
0 32
\ No newline at end of file