2017-05-04 1 views
2

このバナーには3秒間アニメーションがかかるアニメーションがあります。私は に5サイクル後にこの3秒サイクルを停止したい。 と同じように私を助けてもらえますか?私は文のforループとあれば試してみましたが、外側の関数を使用することができる私の目標15秒後に下記のjQueryフェーディングとスライドを止めるには?今は無限に進んでいます

function showBanner(){  
    $(".banner").fadeIn("slow", function(){ 
    $("h1").slideDown("slow", function(){ 
     $("h2").slideDown("slow", function(){ 
     $(".logo").fadeIn("slow", function(){ 
      setTimeout(hideBanner, 3000); 
     }); 
     }); 
    }); 
    }); 
} 

function hideBanner(){ 
    $(".logo").fadeOut("slow", function(){ 
    $("h2").slideUp("slow", function(){ 
     $("h1").slideUp("slow", function(){ 
     $(".banner").fadeOut("fast", function(){ 
      showBanner(); 
     }); 
     }); 
    }); 
    }); 
} 

showBanner(); 

答えて

0

を達成することができない:

1- jQueryのファイルを使用して、いくつかの基本的な理由は、彼らのです

function banner(loops){  
    function showBanner(){  
     $(".banner").fadeIn("slow", function(){ 
      $("h1").slideDown("slow", function(){ 
       $("h2").slideDown("slow", function(){ 
        $(".logo").fadeIn("slow", function(){ 
         setTimeout(hideBanner, 3000); 
        }); 
       }); 
      }); 
     }); 
    } 

    function hideBanner(){ 
     $(".logo").fadeOut("slow", function(){ 
      $("h2").slideUp("slow", function(){ 
       $("h1").slideUp("slow", function(){ 
        $(".banner").fadeOut("fast", function(){ 
         --loops && showBanner(); 
        }); 
       }); 
      }); 
     }); 
    } 
} 

banner(5); 
0

最初とそのjsファイルの最新バージョンにリンクしていることを確認します。

2軌道のタイムコードや単語の追加などのベストアイデアのサンプルコードに従ってください。

、3- // $ pauseOnHoverはブールプロパティがtrueまたはfalseを返すです

jQuery(document).foundation({ 
    orbit: {animation: '<?php echo $Animation; ?>', // Sets the type of animation used for transitioning between slides, can also be 'fade' 
     timer_speed: 15, // Sets the amount of time in milliseconds before transitioning a slide 
     pause_on_hover: <?php echo $pauseOnHover; ?>, // Pauses on the current slide while hovering 
     resume_on_mouseout: <?php echo $pauseOnHover; ?>, // If pause on hover is set to true, this setting resumes playback after mousing out of slide 



このサンプルをお読みください。そのプロパティのループに依存します。そのループでは、サイクリング時間やタイマー時間などの条件を作ることができます。あなたに

$doc->addStyleSheet($modURL . '/css/orbit.css'); 
if ($params->get('jQuery')) {$doc->addScript ('http://code.jquery.com/jquery-latest.pack.js');} 
$doc->addScript($modURL . '/js/foundation.min.js'); 



最高の願いに

最初のリンク。

関連する問題