"ScrollSpy"
Bootstrap 3.3.0 Snippet by megatela

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<body id="home" data-spy="scroll" data-target="#navigation" data-offset="20">
<div class="container">
<div class="row">
<nav class="col-sm-3" id="navigation">
<div class="main-menu" id="navigation">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#inicio">Home</a></li>
<li><a href="#servicios">Services</a></li>
<li><a href="#eventos">Events</a></li>
<li><a href="#menu">Menu</a></li>
<li><a href="#book">Book</a></li>
</ul>
</div>
</nav>
<div class="col-sm-9">
<h1><a href="http://getbootstrap.com/javascript/#scrollspy">ScrollSpy</a></h1>
<div id="inicio">
<h3>Home</h3>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
</div>
<div id="servicios">
<h3>Services</h3>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
</div>
<div id="eventos">
<h3>Events</h3>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
</div>
<div id="menu">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
body {
position: relative;
}
.nav-pills {
top: 20px;
position: fixed;
}
.col-sm-9 div {
height: 200px;
font-size: 14px;
}
#inicio {color: #fff; background-color: #1E88E5;}
#servicios {color: #fff; background-color: #673ab7;}
#eventos {color: #fff; background-color: #ff9800;}
#menu {color: #fff; background-color: #00bcd4;}
#book {color: #fff; background-color: #009688;}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: