是否可以将工具提示添加到缩略图中以在将鼠标悬停在缩略图上时显示完整标题?还有一种方法可以删除“单击此处”按钮并显示缩略图等吗?工作代码可以在这里找到
<script>
$(document).ready(function(){
$("button").click(function(){
$("body").append("<div id = 'data'><ul>.</ul></div>");
var dataContainer = $("#data ul");
$.ajax({
url:'http://gdata.youtube.com/feeds/api/users/googledevelopers/uploads?max-results=50&alt=jsonc&v=2&callback=?',
dataType: "jsonp",
timeout: 5000,
success: function(data){
$.each(data.data.items,
function(i, val) {
if (typeof(val.player) !== 'undefined' && typeof(val.title) !== 'undefined') {
dataContainer.append('<div class="d e"><a href='+val.player["default"]+' target="_blank">'+val.title+'</a><br /><img src="'+val.thumbnail.sqDefault+'" width="120" height="90" alt="'+val.title+'"/><br />Views '+val.viewCount+'</div>');
}
});
}
});
});
});
</script>
<body>
<h2>Youtube Most Viewed</h2>
<p>most viewed today</p>
<p><button>Click Here</button></p>
<p><script language="JavaScript">
<!--
date=Date()
document.write(date)
//-->
</script></p>
</body></html>