I'm trying to add a JavaScript animation effect using the wow.js so I initialize it:
<head>
<link rel="stylesheet" href="css/animate.css">
<script src="js/wow.min.js"></script>
<script>
new WOW().init();
</script>
</head>
and I placed the class effect(wow slideInRight
) inside my div
:
<div class="row row-sm padder-lg ">
<?php
foreach ($top->tracks->track as $key => $value)
{
if($key >= $this->config->item("items_top"))
return false;
$image = $value->image[3]->text;
if($image == '')
$image = $value->image[2]->text;
if($image == '')
$image = base_url()."assets/images/no-cover.png";
?>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<div class="item wow slideInRight">
<img style="background:url('<?php echo $image; ?>')"/>
</div>
</div>
<?php
}
?>
</div>
The problem is that instead of showing the effect for each single item, this JavaScript shows the effect at the same time for all the items. What's the right way to use this JavaScript on a loop?