2014-12-13 31 views
0

我想在動態的方式鏈接VIMEO視頻這樣的:彈出Magnific酒店如何使用iframe的視頻動態URL

jQuery('.overlay.showcases').magnificPopup({ 
    items: [ 
    { 
     src: jQuery(this).find('a').attr('href'), 
     type: 'iframe' 
    } 
    ] 

}); 

但它現在的作品...只顯示黑色屏幕VIMEO,這是html代碼:

<div class="overlay showcases"> 
    <a class="vimeolink" href="<?php echo get_field_escaped("vimeo_link"); ?>">Vimeo Link</a> 
    <h3><?php the_title(); ?></h3> 
    <?php the_excerpt(); ?> 
</div> 

我該如何解決這個問題?

回答

2

我找到解決方案是:

jQuery(".overlay.showcase").click(function() { 
    jQuery.magnificPopup.open({ 
     items: {    
     src: jQuery(this).find('a').attr('href'),   
     type: 'iframe' 
     } 
    }); 
}); 

希望這會幫助別人有這個問題。

相關問題