Last active
September 22, 2017 09:35
-
-
Save DevShahidul/e99c815b9641b1ee3201d019dc5798e3 to your computer and use it in GitHub Desktop.
Example link >>> http://www.webtricker.com/projects/Samsara-v3/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is One way | |
var delayTime = 0.3 | |
$('.nav-wrap ul li').each(function(a){ | |
var thisDelay = delayTime * a | |
thisDelay = thisDelay + "s" | |
$(this).css({ | |
"transition-delay" : thisDelay, | |
//"opacity" : 1 | |
}) | |
}) | |
// This is another way | |
var delayTime = 0.3 | |
$('.nav-wrap ul li').each(function(i){ | |
$(this).css({ | |
"transition-delay" : delayTime *i+ "s", | |
}) | |
}) | |
// Another way with reverse | |
$("#main-nav-wrap .main-nav li").each(function(i){ | |
var delayCounter = i+1 | |
$(this).css({ | |
"transition-delay" : 150*delayCounter+"ms" | |
}) | |
}) | |
var totalElmntCount = $(".main-nav li").length | |
$("#main-nav-wrap.navActive .main-nav li").each(function(i){ | |
var delayCounter = 150*(totalElmntCount-(i+1)) | |
$(this).css({ | |
"transition-delay" : delayCounter+"ms" | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment