Youtube video embedded hidden and display video without playback

146 0

Web sites embed youtube videos, and normal embedding uses the following code:

<embed 
src="http://player.youku.com/player.php/Type/Folder/Fid/16572030/Ob/1/Pt/0/sid/XMzE2MTc2NjQw/v.swf" quality="high" width="480" height="420" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>

Video can be displayed properly.

Wrap the outer layer of the div first. In addition to a link, click on the div and display it, and the video won't show up.
Show white pieces,, display"not loaded movie""

2 Answers

117 5

I did it with jquery. I didn't find you.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
 $("h4").click(function () {
 $(this).next().slideToggle();
 });
}); 
</script>
<h4 href="#" id="display_menu">点击这里</h4>
<div id="display_content" style="display:none;">
<embed 
src="http://player.youku.com/player.php/Type/Folder/Fid/16572030/Ob/1/Pt/0/sid/XMzE2MTc2NjQw/v.swf" quality="high" width="480" height="420" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>
</div>
...