JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://visual24.nl/gcc/js/jquery.stickybar.min.js"></script>
<div class="intro"><h1>Please scroll down</h1></div>
<div class="row">
<div class="col-xs-2">
<div id="menu">
<ul class="nav navigation">
<li><a href="#one">One</a></li>
<li><a href="#two">Two</a></li>
<li><a href="#three">Three</a></li>
<li><a href="#four">Four</a></li>
<li><a href="#five">Five</a></li>
<li><a href="#six">Six</a></li>
<li><a href="#seven">Seven</a></li>
</ul>
</div>
</div>
<!-- end of Menu -->
<!-- Content -->
<div id="content" class="col-xs-10">
<h2 id="one">One</h2>
<p class="text"></p>
<h2 id="two">Two</h2>
<p class="text"></p>
<h2 id="three">Three</h2>
<p class="text"></p>
<h2 id="four">Four</h2>
<p class="text"></p>
<h2 id="five">Five</h2>
<p class="text"></p>
<h2 id="six">Six</h2>
<p class="text"></p>
</div>
</div>
<div class="footer">
<h2 id="seven">Seven</h2>
<p class="text"></p>
</div>
CSS
body, html {
height: 100%;
}
body{
position: relative;
}
.intro {
min-height: 100%;
background: olive;
color: #fff;
text-align: center;
}
h1, h2 {
padding: 40px 0 0;
margin:0;
}
p.text {
height: 700px;
background: #ccc;
}
.active {
background: pink;
}
JavaScript
$(document).ready(function () {
$('#menu').stickyBar();
// Smooth scrolling
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
$('body').scrollspy({ target: '#menu' })