JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<div id="nav">
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#um">Sobre Mim</a></li>
<li><a href="#dois">Galeria</a></li>
<li><a href="#tres">Contato</a></li>
</ul>
</nav>
<div id="home">
<div id="um">
</div>
CSS
html {
height: 100%;
margin: auto;
}
#nav {
background: #FFF;
width: 100%;
}
#nav ul {
list-style: none;
margin-left: 400;
padding: 0;
line-height: 1;
display: block;
zoom: 1;
}
#nav ul:after {
content: " ";
display: block;
font-size: 0;
height: 0;
clear: both;
visibility: hidden;
}
#nav ul li {
display: inline-block;
padding: 0;
margin: 0;
}
#nav.align-left ul li {
float: left;
}
#nav.align-center ul {
text-align: center;
}
#nav ul li a {
color: #000;
text-decoration: none;
display: block;
padding: 15px 25px;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
text-transform: uppercase;
font-size: 14px;
position: relative;
-webkit-transition: color .25s;
-moz-transition: color .25s;
-ms-transition: color .25s;
-o-transition: color .25s;
transition: color .25s;
}
#nav ul li a:hover {
color: #333333;
}
#nav ul li a:hover:before {
width: 100%;
}
#nav ul li a:after {
content: "";
display: block;
position: absolute;
right: -3px;
top: 19px;
height: 6px;
width: 6px;
background: #ffffff;
opacity: .5;
}
#nav ul li a:before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 0;
background: #333333;
-webkit-transition: width .25s;
-moz-transition: width .25s;
-ms-transition: width .25s;
-o-transition: width .25s;
transition: width .25s;
}
#nav ul li.last > a:after,
#nav ul li:last-child > a:after {
display: none;
}
#nav ul li.active a {
color: #333333;
}
#nav ul li.active a:before {
width: 100%;
}
#nav.align-right li.last > a:after,
#nav.align-right li:last-child > a:after {
display: block;
}
#nav.align-right li:first-child a:after {
display: none;
}
#home{
background-color:#06A;
width: 100%;
height: auto;
}
#home, #um{ width: 100%; }
#home{
background:url('http://i.imgur.com/9EaNaJb.jpg') 50% 0 no-repeat fixed;
color: #fff;
height: 600px;
margin: 0;
padding: 200px 0 260px 0;
background-size:...
JavaScript
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
}
});
$(function(){
$.stellar();
});
/*! Stellar.js v0.4.0 | Copyright 2012, Mark Dalgleish | http://markdalgleish.com/projects/stellar.js | http://markdalgleish.mit-license.org */
(function(e,t,n,r){function d(t,n){this.element=t,this.options=e.extend({},s,n),this._defaults=s,this._name=i,this.init()}var i="stellar",s={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,viewportDetectionInterval:1e4,hideElement:function(e){e.hide()},showElement:function(e){e.show()}},o={scroll:{getTop:function(e){return e.scrollTop()},setTop:function(e,t){e.scrollTop(t)},getLeft:function(e){return e.scrollLeft()},setLeft:function(e,t){e.scrollLeft(t)}},position:{getTop:function(e){return parseInt(e.css("top"),10)*-1},setTop:function(e,t){e.css("top",t)},getLeft:function(e){return parseInt(e.css("left"),10)*-1},setLeft:function(e,t){e.css("left",t)}},margin:{getTop:function(e){return parseInt(e.css("margin-top"),10)*-1},setTop:function(e,t){e.css("margin-top",t)},getLeft:function(e){return parseInt(e.css("margin-left"),10)*-1},setLeft:function(e,t){e.css("margin-left",t)}},transform:{getTop:function(e){return e.css(a+"transform")!=="none"?parseInt(e.css(a+"transform").match(/(-?[0-9]+)/g)[5],10)*-1:0},setTop:function(e,t){h(e,t,"Y")},getLeft:function(e){return e.css(a+"transform")!=="none"?parseInt(e.css(a+"transform").match(/(-?[0-9]+)/g)[4],10)*-1:0},setLeft:function(e,t){h(e,t,"X")}}},u={position:{setTop:function(e,t){e.css("top",t)},setLeft:function(e,t){e.css("left",t)}},transform:{setTop:function(e,t,n){h(e,t-n,"Y")},setLeft:function(e,t,n){h(e,t-n,"X")}}},a=function(){var...