2014-12-13 103 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' 
     } 
    }); 
}); 

希望这会帮助别人有这个问题。

相关问题