Download animate.css from this link http://daneden.imtqy.com/animate.css/ and call your html
Then add the "animated" class to the div, and you can apply the animation to your div using "data-animation", that is, data-animation = "flipInY". Here "flipInY" is how your div should appear when custom scrolls are down. You can change the animation of the data as needed. You can also apply a delay to the div using "data-animation" ie data-animation-delay = "400"
<div class="passedMe animated" data-animation="flipInY" data-animation-delay="400">If you passed this div another div will show/hide</div> <div class="showHide animated" data-animation="fadeIn" data-animation-delay="400"> this div will show/hide</div>
Add include the following code in your css
.animated { visibility: hidden; } .visible{ visibility: visible; }
Remember to include animate.css in your html file
Then download jQuery.appear from http://plugins.jquery.com/appear/ and name it in your html
Include the script at the end of the body later
<script> jQuery(function() { jQuery('.animated').appear(function() { var elem = jQuery(this); var animation = elem.data('animation'); if ( !elem.hasClass('visible') ) { var animationDelay = elem.data('animation-delay'); if ( animationDelay ) { setTimeout(function(){ elem.addClass( animation + " visible" ); }, animationDelay); } else { elem.addClass( animation + " visible" ); } } }); }); </script>
source share