我目前正与奇怪的iframe行为作斗争:我有一个bootstrap选项卡,其中有三个youtube iframe。当我第一次转到此选项卡时,iframes会消失,但如果我单击另一个选项卡并返回到带有iframes的选项卡,它们会显示出来!我已尝试使用“Showed”强制iframe重新加载。英国标准。js中的tab事件,iframes出现,重新加载,但随后消失。下面是视频选项卡中的代码
<div id="videoblog" class="tab-pane fade">
<?php
$news_query = new WP_Query(array(\'post_type\'=>\'video\', \'posts_per_page\'=>3));
while ($news_query->have_posts()){
$news_query->the_post();
$video_link = get_post_meta( get_the_id(), \'youtube_link\', true );
$video_link = str_replace("watch?v=", "embed/", $video_link);
?>
<div class="news-item <?php if($post_num == 0 || $post_num == 2) { echo \'left\'; } else { echo \'right\'; } ?>">
<div class="videowrapper">
<iframe src="<?php echo $video_link.\'?rel=0&fs=1\'; ?>" width="650" height="420" allowfullscreen frameborder="0"></iframe>
</div>
<div class="news-item-text pt-sans">
<div class="news-text-wrapper">
<span class=\'news-item-date\'>
<?php echo get_the_date(\'d.m.Y\'); ?>
</span>
<span class="news-item-title">
<?php echo get_the_title(); ?>
</span>
<span class=\'news-item-excerpt\'>
<?php echo get_the_excerpt(); ?>
</span>
</div>
</div>
</div>
<?php } ?>
</div>
我还注意到,如果我用“v/”而不是“embed/”插入视频,视频会显示出来,但全屏按钮不起作用