2012-09-10 67 views
0

我在嘗試顯示iframe時遇到問題。這裏是一件事情:首先我在html5中加載視頻,然後當視頻結束時,該功能隱藏視頻並用jquery顯示iframe div(這是occult),但由於某些原因,當視頻隱藏iframe時出現,當我檢查元件時,標籤在那裏,但是src爲空在Wordpress中顯示iframe

<script src="http://code.jquery.com/jquery-latest.js"></script> 
<script type="text/javascript" charset="utf-8"> 
jQuery(document).ready(function() {  
    jQuery("#video").bind("ended", function() {    
     jQuery("#video-promo").hide();      
     jQuery("#video-streaming").show();  
     });    
}); 
</script> 

這裏而來的HTML:

<div id="video-promo"> 
    <video width="680" height="371" id="video" autoplay="autoplay"> 
     <source src="/video/first_test.m4v" type="video/mp4" /> 
    </video> 
</div> 

<div id="video-streaming" style="display:none;"> 
    <iframe width="560" height="315" src="http://www.youtube.com/embed/FmxSk0wZxss" frameborder="0" allowfullscreen></iframe> 
</div> 

想法?提前致謝。

+0

嘗試刪除'display:none',並在'jQuery(document).ready'事件中放置一個'jQuery('#video-streaming')。hide()'以最初隱藏它 –

+0

仍然無法正常工作。這裏的事情是隱藏和顯示事件的作品,但當我檢查元素是這樣的: '