2017-01-19 10 views
2

一部のセクションでfadeOutにコメントしましたが、2回目のスクロール後に再び表示されることはありません。適切な解決策を見つける。どうすればいい?コールバックがfullPage.jsのセクションにスクロールするたびにコールバックをリセットする

$(document.body).fadeIn(1000); 
    $(document).ready(function() { 

     'use strict'; 

     // variables 
     var $isH1First = $('.first .is-animated h1'), 
      $ispFirst = $('.first .is-animated p'), 
      $isH1Second = $('.second .is-animated h1'), 
      $ispSecond = $('.second .is-animated p'), 
      $isH1Third = $('.third .is-animated h1'), 
      $ispThird = $('.third .is-animated p'); 

     // initialize fullPage 
     $('#fullpage').fullpage({ 

    // navigation: true, 
      scrollingSpeed: 1400, 
      resetSliders:true, 
      fitToSectionDelay: 1000, 

     afterLoad: function(index, nextIndex) { 
     if(nextIndex === 1) { 
       $isH1First.addClass('animated fadeInLeft').css('animation-delay', '.05s'); 
       $ispFirst.addClass('animated fadeInLeft').css('animation-delay', '.45s'); 
      } 
     }, 
     onLeave: function(index, nextIndex) { 
      // first animation 
      if(nextIndex === 2) { 
     //  $isH1First.addClass('animated fadeOutUp'); 
     //  $ispFirst.addClass('animated fadeOutUp'); 
      $isH1Second.addClass('animated fadeInDown').css('animation-delay', '.45s'); 
      $ispSecond.addClass('animated fadeInDown').css('animation-delay', '.85s'); 
      } 
      // second animation 
      else if(nextIndex === 3) { 
     //  $isH1Second.addClass('animated fadeOutUp'); 
     //  $ispSecond.addClass('animated fadeOutUp'); 
      $isH1Third.addClass('animated bounceInDown').css('animation-delay', '.45s'); 
      $ispThird.addClass('animated flipInX').css('animation-delay', '.85s'); 
      } 
     } 
     }); 
    }); 

答えて

0

私は素敵なアニメーションを取得するためにvelocity.jsを使用して、私は一度だけではなく、すべての時間区間負荷をアニメーションを見せたかった、これはかなり遅れている知っています。

私があなたを正しく理解するなら、あなたは私のためのデフォルトの行動であった反対を達成しようとしています。

私のコードの小さな例:

if (index === 1) { 
     //slide 1 animation 
     if (!$jq(".refine").is(":visible") 
     { 
      $jq(".refine").velocity("fadeIn", {duration: 2000}); 
     } 
    } 
関連する問題