Advertisement
Guest User

Untitled

a guest
Oct 8th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript" >
  2. $('.bs-sequence li').addClass('bb-anim-clear');
  3.  
  4. $(window).scroll(function() {
  5.     if (scrollResult('.bs-sequence')) {                             // переместил блок сюда
  6.         showAnim('.bs-sequence li:nth-child(1)', 0);
  7.         showAnim('.bs-sequence li:nth-child(2)', 500);
  8.         showAnim('.bs-sequence li:nth-child(3)', 1000);
  9.     }
  10. });
  11.  
  12. function scrollResult(varCont) {
  13.     var windowHeight = $(window).scrollTop() + $(window).height();
  14.     var blockOffset = varCont.offset().top + varCont.height();
  15.     return windowHeight >= blockOffset;
  16. }
  17. function showAnim(varBlock, varDelay) {
  18.     setInterval(function(){
  19.         $(varBlock).addClass('bb-anim-slide-up');  
  20.     }, varDelay);
  21. }
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement