function ytplayer_render_playlist(){
for(var i=0;i<ytplayer_playlist.length;i++){
var img = document.createElement("img");
img.src="http://img.youtube.com/vi/" + ytplayer_playlist[i] + "/default.jpg";
var a=document.createElement("a");
a.href="#ytplayer";
a.onclick=(function(j){
return function(){
ytplayer_playitem=j;
ytplayer_playlazy(1000);
};
})(i);
a.appendChild(img);
document.getElementById("ytplayer_div2").appendChild(a);
}
}
我可以转换简单的 jquery 代码,但这对我来说太复杂了。