Lightweight,
No dependency,
Navigation-based,
Sliding websites
in seconds!
npm
:
npm install scrollipop
<script src="scrollipop.js"></script>
divs
. Any div
placed as a child of body
will create a fullscreen page.
<body>
<div><!−−Page 1−−></div>
<div><!−−Page 2−−></div>
<div><!−−Page 3−−></div>
</body>
nav
tag. You may utilize either the nav > ul > li
or the nav > a
format.
<body>
<div> <!−−Page 1 div−−>
<nav> <!−−Navigation−−>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</nav>
<p>Hello World!</p> <!−−Other design elements on page 1−−>
</div>
nav
tag may also be placed as a child of body
. The navigation MUST be either a child of body
or a child of any page div
.
<body>
<nav> <!−−Navigation−−>
<a>Link 1</a>
<a>Link 2</a>
<a>Link 3</a>
</nav>
<div> <!−−Page 1 div−−>
<p>Hello World!</p> <!−−Other design elements on page−−>
</div>
body
or a page div
, add the class name main_nav
to whichever navigation instance(s) meant to iterate the site.
<body>
<div> <!−−Page 1 div−−>
<nav> <!−−This menu will NOT scroll through the site's pages.−−>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</nav>
<nav class="main_nav"> <!−−This menu WILL scroll through the site's pages−−>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</nav>
<p>Hello World!</p> <!−−Other design elements on page−−>
</div>
navs
with the class name main_nav
will iterate the site. If none are identified with this class name, none will function.
<body>
<div>
<p>Hello World!</p>
<nav id="best_nav" class="main_nav inst1">
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</nav>
</div>
id
or class
name to style with CSS or JS as usual.