"Affix with Scrollspy "
Bootstrap 3.0.0 Snippet by tlamber

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="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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 data-spy="scroll" data-target="#nav" data-offset="443">
<header id="headline">
<div class="row" id="full-width">
<div class="col-md-3" id="portrait">
<img src="holder.js/317x443" class="text-center bottom-align">
</div>
<div class="col-md-9" id="tagline">
<h1>Follow me @TimLamber </br>and enjoy this affix scrollspy</h1>
<h3>with bootstrap3.0!</h3>
</div>
</div>
</header>
<div id="content">
<div id="nav" data-spy="affix" data-offset-top="443">
<nav class="navbar navbar-affix-top navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand1" href="#why"><img src="holder.js/228x63"></a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse navbar-right">
<ul class="nav navbar-nav">
<li><a href="#pourquoi">Why why why ?</a></li>
<li><a href="#comment">How How How</a></li>
<li><a href="#rdv">Action call</a></li>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
html {
font-size:100%; }
body {
font-size:62.5%; }
.navbar-nav {
font-size: 1.4em; }
html, body, section, .panel, .panel-body {
height:100%;
min-height:100%;
vertical-align: center;
float: none; }
section {
padding-top: 65px;
margin-top: -65px;
margin-bottom: 30px; }
#full-width, #portrait, #tagline {
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
padding-right: 0px; }
#nav.affix {
position: fixed;
top: 0;
width: 100%;
z-index:10; }
.navbar-nav li.active:after {
content: " .";
display: block;
text-indent: -99em;
border-bottom: 0.8em solid #fff;
border-left: 0.8em solid transparent;
border-right: 0.8em solid transparent;
border-top: none;
height: 0px;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: