@mixin delay($initDelay, $addDelay, $n) {
@for $i from 1 to $n {
&:nth-child(#{$i}) {
animation-delay: ($delay+$i*$addDelay)+s
}
}
}
// For example, @include delay(3, 0.3, 3);
// Results in:
// First child having a delay of 3.3
// Second child having a delay of 3.6
// Third child having a delay of 3.9
Handy snippet to delay animation differently for each child
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.