Simple one page header concept
How do I make an simple one page header concept?
What is a simple one page header concept? How do you make a simple one page header concept? This script and codes were developed by Chrysto on 16 July 2022, Saturday.
Simple one page header concept - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple one page header concept</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="header"> <p class="slogan">Section</p> <div class="word"> <ul> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> <li>Six</li> </ul> </div> </div> <div class="content"> <div class="box box1">One</div> <div class="box box2">Two</div> <div class="box box3">Three</div> <div class="box box4">Four</div> <div class="box box5">Five</div> <div class="box box6">Six</div> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple one page header concept - Script Codes CSS Codes
body, div, p{ margin: 0; padding: 0; font-family: Helvetica; } .header{ position: fixed; z-index: 1000; width: 100%; height: 100px; background-color: black; color: white; } .header p{ display: inline-block; padding-left: 40px; font-size: 24px; line-height: 30px; padding-top: 30px; } .word{ position: absolute; top: 30px; display: inline-block; width: 400px; height: 30px; overflow: hidden; } ul{ list-style: none; position: absolute; } ul li{ font-size: 24px; } .content .box{ width: 100%; height: 700px; } .box1{ background-color: #88b6f7; } .box2{ background-color: #9a9bff; } .box3{ background-color: #bbfb94; } .box4{ background-color: #ed74c4; } .box5{ background-color: #eb984e; } .box6{ background-color: #a9eaf1; }
Simple one page header concept - Script Codes JS Codes
var $window = $(window) var $box = $(".box"); var $menus = $(".header ul"); var currentIndex = 0; var lastIndex = -1; var positions = [] // $menus.find("li").each(function(index){ $(this).css({ position: "absolute", top: index*74, color: $box.eq(index).css("background-color") }); setHeader(); }); // $window.scroll(function() { var scrollTop = $window.scrollTop(); $.each(positions, function(index, value){ if(value > scrollTop ){ if(currentIndex != index){ lastIndex = currentIndex; currentIndex = index; setHeader(); } return false; } }); }); function setHeader(){ TweenLite.to( $menus, 0.5, {top: -74*currentIndex - 14 }); if(currentIndex > lastIndex){ //some animation from top to bottom //console.log("otgore nadolu"); } else { //some animation from bottom to top //console.log("otdolu nagore"); } } $window.resize(function(){ positions.length = 0; $box.each(function(){ var $elem = $(this); return positions.push( parseInt($elem.offset().top + $elem.height() - 100)); }); }).resize();
Developer | Chrysto |
Username | bassta |
Uploaded | July 16, 2022 |
Rating | 4 |
Size | 2,530 Kb |
Views | 52,624 |
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 |
Lastik menu | 2,257 Kb |
Click outside element | 1,993 Kb |
Single page website | 2,688 Kb |
GSAP Parallax | 2,513 Kb |
Infinite scrolling horizontal text | 2,438 Kb |
One page website scrolling effect | 2,764 Kb |
Medium.com style header effect | 2,828 Kb |
TweenMax text - changing slogans | 2,333 Kb |
Simple GSAP Slider | 2,839 Kb |
Fullscreen Parallax | 3,313 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 |
Angular Route | Arun_v606 | 1,837 Kb |
A Pen by Mike Otis | Mikeotis | 3,185 Kb |
Hamburger Menu Animation | Salmanraza | 2,580 Kb |
Parallax-ish Sliding Content | Jdsteinbach | 2,748 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Draggables in pure angular | Rlo206 | 5,167 Kb |
Dribbble Template | ExtremelyGinger | 2,204 Kb |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
Display properties | Hamzaerbay | 1,886 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!