Created
September 20, 2018 17:07
-
-
Save thisisjamessmith/2362756c5e21035a262cc4305ced68a6 to your computer and use it in GitHub Desktop.
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 alternative version creates the delays based on an easing curve. | |
// Nice, but needs some tweaking. See here: http://sol.gfxile.net/interpolation/ | |
$('.js-transitionDelays').each(function(){ | |
var items = $(this).find('> li > a'); | |
var total = items.length; | |
items.each(function(i) { | |
var multiplier = i/total; | |
var speedFactor = 0.39; | |
var j = .22; // starting base value | |
var k = speedFactor *(Math.sin(multiplier * Math.PI/2)); | |
var string = j + k + 's'; | |
$(this).css({'transition-delay':string}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment