JSFiddle - React, Tailwind, and code Playground
by sibin va
HTML
<script src="http://guidobouman.github.io/jquery-panelsnap/jquery.panelSnap.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<section class="bg-1">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 1</h1>
</div>
</div>
</div>
</section>
<section class="bg-2">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 2</h1>
</div>
</div>
</div>
</section>
<section class="bg-3">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 3</h1>
</div>
</div>
</div>
</section>
<section class="bg-4">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 4</h1>
</div>
</div>
</div>
</section>
<section class="bg-5">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 5</h1>
</div>
</div>
</div>
</section>
<section class="bg-6">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 6</h1>
</div>
</div>
</div>
</section>
<section class="bg-7">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>teste 7</h1>
</div>
</div>
</div>
</section>
CSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
/*css - reset*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content:'';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*css global*/
body {
overflow-x: hidden;
}
section {
overflow: hidden;
width: 100%;
height: 100%;
min-height:100vh;
}
.panels.offset section {
height: calc(100% - 5px);
}
h1 {
color:#fff;
font-size: 2.500em;
}
h2 {
font-size: 2.500em;
}
h3 {
font-size: 1.800em;
}
h4 {
font-size: 1.125em;
}
p {
font-size:1.500em;
}
;
.center-content {
position: absolute;
z-index: 99999999;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
header {
position: fixed;
height: 80px;
background-color: transparent;
border:1px solid #fff;
width: 100%;
width: 100vw;
}
.bg-1 {
background:#F68A2F url('http://codyhouse.co/demo/alternate-fixed-scroll-background/img/cd-background-1.jpg') repeat center center;
background-size: cover;
background-attachment:...
JavaScript
$('body').panelSnap({
panelSelector: '> section',
keyboardNavigation: {
enabled: true,
nextPanelKey: 39,
previousPanelKey: 37,
wrapAround: false
},
onSnapFinish: function () {
console.log('finish');
}
});