The following php code generates three list items. I want to add/remove a css class active on mouseover/mouseout. The js shown below toggles the class active successfully, but all at once as I mouseover on an item. I want to animate a single list item on hover. Since its a loop, I do not quite understanding how to animate individual list item on mouseover. Another requirement is that I would like to animate the list items automatically in addition to manual hovering after 5 seconds each as the page loads. I am not very conversant with js so any insights you offer to me will be much appreciated.
<ul class="daily-featured__videos">
<?php for ($i = 0; $i < 3; $i++) : ?>
<li class="the-daily-featured__video daily-featured__video active">
<div class="daily-featured__video-image">
<a href="<?php echo $this->url($this->videos[$i]->getProperties(), 'media_video_view'); ?>" >
<img title="<?php echo addslashes($this->videos[$i]->title); ?>" src="<?php echo $this->videos[$i]->getPoster('small'); ?>" style="width: 258px;">
<div class="thumbnail-action-button icon-play the-thumnbail-action-button" data-label="<?php echo $this->videos[$i]->duration; ?>" ></div>
</a>
</div>
<div class="daily-featured__video-text">
<div class="daily-featured__video-channel"><?php echo $this->videos[$i]->credit; ?></div>
<h2 class="daily-featured__video-title">
<a href="<?php echo $this->url($this->videos[$i]->getProperties(), 'media_video_view'); ?>">
<?php echo $this->videos[$i]->title; ?>
</a>
</h2>
<?php daily_featured_socials(); ?>
</div>
</li>
<?php endfor; ?>
</ul>
<script type="text/javascript">
$(document).ready(function() {
$(".the-daily-featured__video").hover(function() {
$(".the-daily-featured__video").toggleClass("active");
});
});
</script>