Trying to add a border to the thumbnail video that’s playing in the iframe.
$('document').ready(function(){
$("#video-thumbs li").click(function(e){
e.preventDefault();
$("#video-thumbs li").addClass("current").not(this).removeClass("current");
});
});
<iframe width="1020" height="574" id="myvideo" src="http://www.youtube.com/embed/Qdse1SEBimw" frameborder="0" allowfullscreen=""></iframe>
<ul id="video-thumbs">
<li class="current" style="margin-left: 0;">
<div id="playbtn" onclick="document.getElementById('myvideo').src='http://www.youtube.com/embed/Qdse1SEBimw'"></div>
<img src="files/lamb.png" width="326" height="181">
</li>
<li>
<div id="playbtn" onclick="document.getElementById('myvideo').src='http://www.youtube.com/embed/WZknytdWWhI'"></div>
<img src="files/tuna.png" style="width: 326px">
</li>
<li style="margin: 0 0 0 11px">
<div id="playbtn" onclick="document.getElementById('myvideo').src='http://www.youtube.com/embed/BAembvTjChs'"></div>
<img src="files/myers.png" width="326" height="181">
</li>
</ul>
Try structuring the HTML differently, and remove those unsigthly onclick functions :
Now do some jQuery stuff :
And it should work fine ?
Here’s a FIDDLE