Last active
October 14, 2019 19:45
-
-
Save builtbylane/7462086 to your computer and use it in GitHub Desktop.
jQuery: add class to each item incrementally... good for fading in blocks
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
$(function() { | |
'use strict'; | |
// deps... jquery | |
var $fade_this_in = $('.something-with-opacity-0'); | |
function laneAddClassDelay(jquerobj, theclass, theinterval) { | |
setTimeout(function() { | |
jquerobj.addClass(theclass); | |
}, theinterval); | |
} | |
// fade in each thumb incrementally | |
$fade_this_in.each(function(i) { | |
laneAddClassDelay($(this), 'fadein', 200 * i); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment