JSFiddle - React, Tailwind, and code Playground
by Torwan
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.0/js/bootstrap.min.js"></script>
<!-- ciekawy temat zwiazany z zmianą rozdzielczości i affixem https://www.jero.co.nz/blog/bootstrap-affix-plugin/ -->
<body data-spy="scroll" data-target=".scrollspy">
<div class="jumbotron">
<div class="container">
<h1>Playing with Bootstrap</h1>
<h3><span class="fa fa-pencil"></span> Affix & Scrollspy plugins help you create nice scrolling effects.</h3>
<h3><span class="fa fa-pencil"></span> Minimal code is needed. Plugins take care of the rest.</h3>
<h3><span class="fa fa-pencil"></span> This demo will help you understand how to use them in your projects.</h3>
<a href="http://www.sitepoint.com/understanding-bootstraps-affix-scrollspy-plugins" class="btn btn-primary btn-lg">Learn More</a>
</div>
</div><!--end of .jumbotron-->
<div class="container">
<div class="row">
<div class="col-md-3 scrollspy">
<ul id="nav" class="nav hidden-xs hidden-sm" data-spy="affix">
<li><a href="#web-design">Web Design</a></li>
<li><a href="#web-development">Web Development</a>
<ul class="nav">
<li><a href="#ruby"><span class="fa fa-angle-double-right"></span>Ruby</a></li>
<li><a href="#python"><span class="fa fa-angle-double-right"></span>Python</a></li>
<li><a href="#php"><span class="fa fa-angle-double-right"></span>PHP</a></li>
</ul>
</li>
<li><a href="#marketing">Marketing</a></li>
<li><a href="#graphic-design">Graphic Design</a></li>
<li><a href="#logistics">Logistics</a></li>
<li><a href="#social">Social</a></li>
<li><a href="#management">Management</a></li>
<li><a href="#chemistry">Chemistry</a></li>
<li><a href="#mobile-development">Mobile...
CSS
@import url(https://fonts.googleapis.com/css?family=Raleway:400,700);
body {
background: lightblue;
position: relative;
line-height: 1.5;
font-family: 'Raleway', sans-serif;
}
h1, h2 {
font-weight: 700;
}
h3 span {
color: #286090;
}
.jumbotron {
border-radius: 0px;
background: #5fb3ce;
margin-bottom: 0;
}
.jumbotron button {
margin-top: 10px;
}
section {
padding: 40px 0;
border-bottom: 1px solid #c1e1ec;
}
#web-development,
#mobile-development {
padding-bottom: 0;
}
section:last-child {
border-bottom: none;
}
.nav {
background: #4baac8;
}
.nav a {
color: black;
font-style: italic;
}
.nav li a:hover,
.nav li a:focus {
background: #86c5da;
}
.nav .active {
font-weight: bold;
background: #72bcd4;
}
.nav .nav {
display: none;
}
.nav .active .nav {
display: block;
}
.nav .nav a {
font-weight: normal;
font-size: .85em;
}
.nav .nav span {
margin: 0 5px 0 2px;
}
.nav .nav .active a,
.nav .nav .active:hover a,
.nav .nav .active:focus a {
font-weight: bold;
padding-left: 30px;
border-left: 5px solid black;
}
.nav .nav .active span,
.nav .nav .active:hover span,
.nav .nav .active:focus span {
display: none;
}
.application {
border-top: 1px solid #c1e1ec;
}
.affix-top {
position: relative;
}
.affix {
top: 20px;
}
.affix,
.affix-bottom {
width: 213px;
}
.affix-bottom {
position: absolute;
}
footer {
border-top: 1px solid #c1e1ec;
height: 50px;
}
footer p {
line-height: 50px;
margin-bottom: 0;
}
@media (min-width:1200px) {
.affix,
.affix-bottom {
width: 263px;
}
}
JavaScript
$('#nav').affix({
offset: {
top: $('#nav').offset().top,
bottom: ($('footer').outerHeight(true) + $('.application').outerHeight(true)) + 40
}
});