嗨我的頁面中有2個按鈕和2個視頻,但我希望只有一個視頻在我的屏幕中,如果我想觀看另一個視頻,我只需要單擊第二個按鈕。我需要JavaScript還是有任何簡單的方法?使用按鈕更改視頻
https://jsfiddle.net/xfyL11tt/
<h2><u>Cats</u></h2>
<div id="random-tab-id-408" class="tabs-shortcode tabs-shortcode-top">
<ul class="tabs-shortcode-list">
<li ><a href="#cat2" >Cat 1</a></li>
<li ><a href="#cat1" >Cat 2</a></li>
</ul>
<div id="cat1" >
<div class="embed-box">
<iframe width="560" height="315" src="https://www.youtube.com/embed/tntOCGkgt98" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div id="cat2" >
<div class="embed-box">
<iframe width="420" height="315" src="https://www.youtube.com/embed/yAIGLAgEa84" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
你可以用java腳本的幫助下做到這一點。 – RajSharma