-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrollspy.html
More file actions
74 lines (67 loc) · 2.74 KB
/
scrollspy.html
File metadata and controls
74 lines (67 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Scrollspy</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- bootstrap necessities -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- compiled bootstrap -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
body{
position: relative;
}
/* Define styles for each section */
#section1 {padding-top: 45px; height:500px; background-color:cyan;}
#section2 {padding-top: 45px; height:500px; background-color:yellow;}
#section3 {padding-top: 45px; height:500px; background-color:pink;}
#section4 {padding-top: 45px; height:500px; background-color:magenta;}
</style>
</head>
<body data-spy="scroll" data-target=".navbar">
<!-- Navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<!-- Container -->
<div class="container-fluid">
<!-- Collapse Icon -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#!">My Website</a>
</div>
<!-- Navbar Links -->
<div class="collapse navbar-collapse" id="nav1">
<ul class="nav navbar-nav">
<li><a href="#section1">Link 1</a></li>
<li><a href="#section2">Link 2</a></li>
<li><a href="#section3">Link 3</a></li>
<li><a href="#section4">Link 4</a></li>
</ul>
</div>
</div>
</nav>
<!-- Content Sections -->
<div id="section1" class="container-fluid">
<h1>Link 1</h1>
<p>Content</p>
</div>
<div id="section2" class="container-fluid">
<h1>Link 2</h1>
<p>Content</p>
</div>
<div id="section3" class="container-fluid">
<h1>Link 3</h1>
<p>Content</p>
</div>
<div id="section4" class="container-fluid">
<h1>Link 4</h1>
<p>Content</p>
</div>
</body>
</head>html>