I'm trying to figure out how I can make my list items in a list fadeInUp with a delay on 100ms per list item.
I have made this so far and it does apply the classes to animate it and the attribute with a value of 100ms increase per list item. But when I hover, all items fadeInUp at the same time, even though data-wow-delay is applied and i have no console error from my wow.js library. Any ideas? Cheers.
<nav id="site-navigation" class="main-navigation" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<h1 class="nocontent outline">Hoved navigation</h1>
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'crafthouse-agency' ); ?></button>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
<?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_id' => 'secondary-menu' ) ); ?>
<ul class="social-share-section">
<li>
<a href="#" class="social-share">
<svg class="facebook-header">
<use xlink:href="#facebook"></use>
</svg>
<span class="share-text">Del "" <span class="screen-reader-text">på Facebook</span></span>
</a>
</li>
<li>
<a href="#" class="social-share">
<svg class="linkedin-header">
<use xlink:href="#linkedin"></use>
</svg>
<span class="share-text">Del "" <span class="screen-reader-text">på LinkedIn</span></span>
</a>
</li>
</ul>
</nav><!-- #site-navigation -->
@keyframes fadeInUp {
0% {
opacity: 0;
-webkit-transform: translate3d(0, 20%, 0);
transform: translate3d(0, 32%, 0);
}
100% {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
// Dropdown menu animation
$("#primary-menu > li > a").on("hover focus", function(){
var current = 0;
$(".sub-menu .menu-item").each(function() {
$(this).addClass("animated wow fadeInUp");
$(this).attr("data-wow-delay", current+"00ms");
current++;
});
});