Reputation: 2126
I got videos list using AJAX, and me want to play a top video an a light box? So after viewing list how it is possible to play video automatically?
Upvotes: 2
Views: 5769
Reputation: 33335
html code
<a id="a_lnk" href="http:\\www.cnn.com">cnn</a>
javascript code
// find a <a> element with id a_lnk
var lnk = document.getElementById('a_lnk');
lnk.onclick = function(e){
// do the magic here..
// e.target is the object that got the click
window.location = e.target.getAttribute('href');
return false;
}
complete example here
can also be done with jQuery if that is your thing
Upvotes: 3