I'm on CodeIgniter with Bootstrap and I have a problem with wow.js, only items in viewport are shown instead on scroll down all items are there but the visibility is equal to hidden and doesn't change it.
The problem is that I'm on a scrollable section.
UPDATE
I found a workaround here, so for the purpose I used the wow.js
for the animation and the isInViewport.min.js
for the triggering.
My head
:
<head>
<link rel="stylesheet" href="css/animate.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script>
<script src="js/wow.min.js"></script>
</head>
My template
:
<section id="scrollab" class="scrollable w-f-md" style="position:fixed; z-index:1">
<div id="target" style="height:100%;">
<?php getPage($page); ?>
</div> <!-- /target -->
</section>
My view
: (it's the page target)
<!DOCTYPE html>
<script src="isInViewport.min.js"></script>
<div class="row row-sm padder-lg ">
<?php
foreach ($top->feed->entry as $key => $value)
{
$value->title->label = str_ireplace( "- ".$value->artist->label, "", $value->title->label);
if($key >= $this->config->item("items_top"))
continue;
$image = $value->image[2]->label;
if($image == '')
$image = base_url()."assets/images/no-cover.png";
$image = str_ireplace("170x170", "200x200", $image);
?>
<div class="wow bounceInUp col-sm-4" style="visibility:hidden;">
<div class="item " >
<div class="pos-rlt ">
<figure class="effect-main-2">
<img class="img-full" src="<?php echo $image; ?>"/>
<figcaption>
<div style="overflow:hidden;"></div>
<div class="item-overlay opacity">
<span class="text-center">
<i class="icon-control-play"></i>
</span>
</div>
</figcaption>
</figure>
</div>
</div>
</div>
<script>
new WOW().init();
</script>
And then, on the same view as suggested, I added this script:
<script>
var scrollable = $('#scrollab');
scrollable.on('scroll.wow', function(){
scrollable.find('.wow:not(.animated):in-viewport').removeAttr('style').addClass('animated');
}));
</script>
</div>
Now everything works fine, thanks to you all.