2017-04-05 2 views
1

2つの異なるjqueryをページの読み込みで実行するにはどうすればよいですか?

mounted: function() { 
 
     $(function(){ 
 
      $(document).ready(function(){ 
 
      Tour.run([ 
 
       { 
 
       element: $('#interest'), 
 
       content: 'by default tour is on the right' 
 
       }, 
 
       { 
 
       element: $('#course'), 
 
       content: 'but it can be on top', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#trade'), 
 
       content: 'bottom', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#district'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#InstituteSearch'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#btn-search'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#btn-claear'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       } 
 
      ]); 
 
      }); 
 
     }); 
 
    (function($) { 
 
     $(document).ready(function() { 
 
      $.magnificPopup.open({ 
 
      items: { 
 
       src: 'https://www.youtube.com/watch?v=K8E6xsac2MU' 
 
      }, 
 
      type: 'iframe' 
 
      }, 0); 
 
     }); 
 
     })(jQuery); 
 
    },

私は、これら二つのjqueryのプラグインを持っています。 1つはオーバーレイ用です&もう1つはポップアップビデオです。両方ともページload.Iで実行され、最初にページの読み込み時にビデオをポップアップしたい。ビデオを閉じると、オーバーレイのjqueryが実行されます。

答えて

1

ビデオポップアップが閉じているときに閉じるときに実行する関数として最初のものを宣言します。

$.magnificPopup.open({ 
      items: { 
       src: 'https://www.youtube.com/watch?v=K8E6xsac2MU' 
      }, 
      type: 'iframe', 
      close: function() { 
       // Will fire when popup is closed 
       TourRun(); 
        } 
      }, 0); 
     }); 
-1

mounted: function() { 
 
     $(function(){ 
 
      $(document).ready(function(){ 
 

 
     $.magnificPopup.open({ 
 
      items: { 
 
       src: 'https://www.youtube.com/watch?v=K8E6xsac2MU' 
 
      }, 
 
      type: 'iframe', 
 
      close: function() { 
 
       // Will fire when popup is closed 
 

 
       Tour.run([ 
 
       { 
 
       element: $('#interest'), 
 
       content: 'by default tour is on the right' 
 
       }, 
 
       { 
 
       element: $('#course'), 
 
       content: 'but it can be on top', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#trade'), 
 
       content: 'bottom', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#district'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#InstituteSearch'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#btn-search'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       }, 
 
       { 
 
       element: $('#btn-claear'), 
 
       content: 'and finally on the left', 
 
       position: 'right' 
 
       } 
 
      ]); 
 
      } 
 
      }, 0); 
 
     }); 
 
     }); 
 
       
 
    },

こんにちはこれは、オーバーレイが

を実行していない、唯一のビデオポップアップを表示
関連する問題