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 |
Simple GSAP Slider | 2,839 Kb |
GSAP Parallax | 2,513 Kb |
Page Header animation | 2,828 Kb |
Infinite scrolling horizontal text | 2,438 Kb |
Lastik menu | 2,257 Kb |
TweenMax text - changing slogans | 2,333 Kb |
Smooth scroll | 4,915 Kb |
TweenLite staggerTo | 2,495 Kb |
Fullscreen image in Canvas | 2,268 Kb |
Medium.com style header effect | 2,828 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 |
Ipad Mini Showcase | Hornebom | 10,479 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Hc first draft | Stepfray | 5,104 Kb |
Sony Xperia Z3 Flat MockUp | Dapinitial | 4,379 Kb |
Social buttons | Flacu | 2,022 Kb |
Slider for stackoverflow | KKOKU | 3,222 Kb |
Popup Modal | Aldlevine | 3,696 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
SnappySnippet Test | Elmsoftware | 8,385 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!