-1
現在我想要的是#youtube隨時顯示,但如果單擊它,我想將其轉換爲#embed。無法讓它工作。我的意思是,它不做我剛剛解釋的。什麼都沒發生。單擊時用另一個div替換div
<div id="youtube" onclick="replace()" style="display:block">
<img src="http://img.youtube.com/vi/'.$id.'/1.jpg">
<span class="title"><font color="#999">YouTube™ Video:</font> '.$title.'</span>
<span class="views">Views: '.number_format($views).'</span>
<span class="description">'.$desc.'</span>
</div>
// show this only if they clicked on #youtube
<div id="embed" onclick="replace()" style="display:none">
<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/$1?fs=1"</param>
<param name="allowFullScreen" value="true"></param>
<param name="allowScriptAccess" value="always"></param>
<embed src="http://www.youtube.com/v/$1?fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always" allowFullScreen="true" width="425" height="344">
</embed>
</object>
</div>
JS:
[瞭解如何** **調試JavaScript的(http://www.netmagazine.com/tutorials/javascript-debugging-beginners)。 –