Vertical Scrolling Pagination
How do I make an vertical scrolling pagination?
What is a vertical scrolling pagination? How do you make a vertical scrolling pagination? This script and codes were developed by Ali Klein on 11 July 2022, Monday.
Vertical Scrolling Pagination - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Vertical Scrolling Pagination</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul id="pagination"> <li><a href="#page1"></a></li> <li><a href="#page2"></a></li> <li><a href="#page3"></a></li> <li><a href="#page4"></a></li> <li><a href="#page5"></a></li>
</ul>
<div class="main"> <section id="page1"> <div class="page_container"> <h1>Page 1</h1> </div> </section> <section id="page2"> <div class="page_container"> <h1>Page 2</h1> </div> </section> <section id="page3"> <div class="page_container"> <h1>Page 3</h1> </div> </section> <section id="page4"> <div class="page_container"> <h1>Page 4</h1> </div> </section> <section id="page5"> <div class="page_container"> <h1>Page 5</h1> </div> </section>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-smooth-scroll/2.0.0/jquery.smooth-scroll.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Vertical Scrolling Pagination - Script Codes CSS Codes
.main section { margin: 0; height: 100vh;
}
.main section:nth-child(1) { background-color: #435656;
}
.main section:nth-child(2) { background-color: #526a6a;
}
.main section:nth-child(3) { background-color: #627e7e;
}
.main section:nth-child(4) { background-color: #729292;
}
.main section:nth-child(5) { background-color: #86a2a2;
}
.main section h1 { font-size: 38px; color: #fff; margin: 0; padding: 50px 0 20px; text-align: center;
}
#pagination { position: fixed; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); right: 30px; list-style: none;
}
#pagination li { position: relative; margin: 20px 0; background: #fff; border-radius: 100%; width: 8px; height: 8px; -webkit-transition: all .2s ease; transition: all .2s ease;
}
#pagination li:hover { -webkit-transform: scale(1.5); transform: scale(1.5);
}
#pagination a { position: absolute; text-decoration: none; left: 0; top: 0; color: inherit; width: 100%; height: 100%;
}
body { font-family: sans-serif; margin: 0;
}
.active-dot, body.page-1 #pagination li:first-of-type, body.page-2 #pagination li:nth-of-type(2), body.page-3 #pagination li:nth-of-type(3), body.page-4 #pagination li:nth-of-type(4), body.page-5 #pagination li:nth-of-type(5) { -webkit-transform: scale(2); transform: scale(2);
}
Vertical Scrolling Pagination - Script Codes JS Codes
function pagination() { var offset = $(document).scrollTop(), windowHeight = $(window).height(), body = $('body'); switch (true) { case (offset > (windowHeight * 3.75)): body.removeClass().addClass('page-5'); break; case (offset > (windowHeight * 2.75)): body.removeClass().addClass('page-4'); break; case (offset > (windowHeight * 1.75)): body.removeClass().addClass('page-3'); break; case (offset > (windowHeight * .75)): body.removeClass().addClass('page-2'); break; case (offset < windowHeight): body.removeClass().addClass('page-1'); break; default: body.removeClass().addClass('page-1'); }
}
pagination();
$(document).scroll(function() { pagination();
});
$('a').smoothScroll();
Developer | Ali Klein |
Username | AliKlein |
Uploaded | July 11, 2022 |
Rating | 3 |
Size | 2,980 Kb |
Views | 56,672 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Parallax Background Scroll | 3,150 Kb |
Speech Bubble Animation | 3,562 Kb |
Buzzy Pen | 5,034 Kb |
Owl Carousel Sync Nav Links | 2,554 Kb |
Horizontal Scroll Progress Bar | 2,705 Kb |
Mobile Nav Menu | 4,745 Kb |
CSS Motion Path Airplane | 4,035 Kb |
David Bowie SVG Morph | 11,407 Kb |
Youtube API Multiple Videos | 2,326 Kb |
Momentum Scrolling | 2,614 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
React Vote Component | Souporserious | 5,465 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
Wip elementary os navbar | Nickcolley | 2,993 Kb |
Segments mouse following | Nosir | 2,909 Kb |
Beveled corners using CSS border attribute | DawsonMediaD | 2,136 Kb |
Chuck Norris Background | Manz | 1,967 Kb |
Resize image | Happyhj | 1,892 Kb |
UI Challenge - Budget Selector | AgentRR007 | 3,547 Kb |
Simple Flat Menu | Jeplaa | 2,467 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!