Lastik menu
How do I make an lastik menu?
Simple lava-lamp like horizontal menu, using Tweenmax . What is a lastik menu? How do you make a lastik menu? This script and codes were developed by Chrysto on 16 July 2022, Saturday.
Lastik menu - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Lastik menu</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="menu"> <ul id="menu-list"> <li> <a href="#">Home</a></li> <li> <a href="#">Gallery</a></li> <li> <a href="#">Contacts</a></li> <li> <a href="#">Blog</a></li> </ul> <div id="menu-line"></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>
Lastik menu - Script Codes CSS Codes
html, body, div { margin: 0; padding: 0; font-family: "Helvetica Neue", Helvetica, sans-serif;
}
#menu{ position: relative; text-align: center; margin: 100px;
}
#menu-line{ display: block; position: absolute; left: 50%; top: 25px; width: 0; height: 5px; background-color: black;
}
ul{ z-index: 100;
}
ul li { display: inline-block; margin-right: 30px;
}
ul li a{ display: block; font-size: 20px; text-transform: uppercase; text-decoration: none; color: black;
}
Lastik menu - Script Codes JS Codes
$(function(){ var currentIndex = 0; var _offset = 10; var $menuLi = $("#menu-list li"); var $line = $("#menu-line"); $menuLi.on("click", function(){ var _$this = $(this); TweenMax.killTweensOf($line); if( _$this.index() > currentIndex ){ TweenMax.to($line, 0.5, {css: {width: (_$this.position().left + _$this.outerWidth()) - $line.position().left + _offset/2 }, onComplete:function(){ currentIndex = _$this.index(); TweenMax.to($line, 0.5, { css:{ left : _$this.position().left - _offset/2, width: _$this.outerWidth() + _offset } }) } }); } else { TweenMax.to($line, 0.5, {css: { left: _$this.position().left - _offset/2, width: ($line.position().left + $line.outerWidth()) - _$this.position().left + _offset/2 }, onComplete:function(){ currentIndex = _$this.index(); TweenMax.to($line, 0.5, { css:{ width: _$this.outerWidth() + _offset } }) } }); } }); });
Developer | Chrysto |
Username | bassta |
Uploaded | July 16, 2022 |
Rating | 4 |
Size | 2,257 Kb |
Views | 40,480 |
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 |
GIF-like animation with single image | 1,807 Kb |
TweenLite staggerTo | 2,495 Kb |
GSAP Parallax | 2,513 Kb |
Medium.com style header effect | 2,828 Kb |
One page website scrolling effect | 2,764 Kb |
Simple one page header concept | 2,530 Kb |
Page Header animation | 2,828 Kb |
Infinite scrolling horizontal text | 2,438 Kb |
Fullscreen image in Canvas | 2,268 Kb |
Single page website | 2,688 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 |
Fixed with using Calc | Tomleo | 2,542 Kb |
Flex Chart | James_zedd | 4,111 Kb |
Scifi-style Interative Form | Aaronchuo | 4,566 Kb |
Acorrdian 2016 | Milanodituti | 3,720 Kb |
Donald Trump - The New Yorker | Agbales | 2,502 Kb |
Pure CSS Dial | Lukewatts | 3,018 Kb |
Shopping cart | Andiio | 6,581 Kb |
JS Beispiel getElementsByClassName 3 | HSZG-Frontend-Kurs | 1,988 Kb |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
A vuejs widget | Chrgl86 | 2,869 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!