2016-04-05 19 views
0

Fancyboxを表示する2つのJQuery関数と2つ目のowl-carouselを作成するJQuery関数があるので、fancybox関数の実行後にawlカルーセル関数を実行します。別の完了後にJQuery関数を実行する

$(document).ready(function() { 
    $(".fancybox1").fancybox({ 
     content : '<div class="col-md-6"><div id="fancybox12" class="owl-carousel owl-theme"><div class="item"><img src="img/portfolio/102.jpg" class="img-responsive" alt="..."></div></div></div><div class="text-center col-md-6"><h1> T-Shirts & Fabric Printing </h1></div> ' 
    }), 
    $("#fancybox12").owlCarousel({ 
      navigation : false, // Show next and prev buttons 
      slideSpeed : 300, 
      paginationSpeed : 400, 
      singleItem:true 
    }); 
}); 

しかし、私は私を助けるwork.Pleaseためのコールバックを取得することができませんよ。 おかげ

答えて

0

は別の関数でそれらを持ってみて、このようにその関数を呼び出します。

(document).ready(function() { 
    runfancybox(); 

    function runfancybox(){ 
    $(".fancybox1").fancybox({ 
      content : '<div class="col-md-6"><div id="fancybox12" class="owl-carousel owl-theme"><div class="item"><img src="img/portfolio/102.jpg" class="img-responsive" alt="..."></div></div></div><div class="text-center col-md-6"><h1> T-Shirts & Fabric Printing </h1></div> ' 
     }); 
     runOwlCarousel(); 
    } 


    function runOwlCarousel(){ 
     $("#fancybox12").owlCarousel({ 
      navigation : false, // Show next and prev buttons 
      slideSpeed : 300, 
      paginationSpeed : 400, 
      singleItem:true 
      });  
    } 
}); 
関連する問題