你好我想创建一个youtube播放列表,就像我尝试过代码
的界面一样<script>
$(document).ready(function(){
$('.video_display').html('<iframe width="388" height="263" src="http://www.youtube.com/embed/qK0w8PmpA8Q" frameborder="0" allowfullscreen></iframe>);
$('#img1').click(function(){
$('.video_display').html('<iframe width="388" height="293" src="http://www.youtube.com/embed/nfjD9Kz8DDY" frameborder="0" allowfullscreen></iframe>');
})
})
</script>
HTML
<ul>
<li id="img1"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img2"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img3"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img4"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img5"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img6"><img src="images/footer_img.jpg" alt=" " /></li>
<li id="img7"><img src="images/footer_img.jpg" alt=" " /></li>
</ul>
我的脚本没有工作PLZ帮助
由于
答案 0 :(得分:3)
是的;你错过了一个结束语:jsfiddle here: demo http://jsfiddle.net/ghqby/11/
试试这个:
<script>
$(document).ready(function(){
$('.video_display').html('<iframe width="388" height="263" src="http://www.youtube.com/embed/qK0w8PmpA8Q" frameborder="0" allowfullscreen></iframe>');
$('#img1').click(function(){
$('.video_display').html('<iframe width="388" height="293" src="http://www.youtube.com/embed/nfjD9Kz8DDY" frameborder="0" allowfullscreen></iframe>');
})
})
</script>
这会有所帮助,欢呼!