我正在尝试将 youtube api 提要粘贴到此页面上,但缩略图没有正确排列。工作地点可以在这里找到。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Inner page</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div id="main_block">
<div id="innerblock">
<!--Top Panel starts here -->
<div id="top_panel">
<a href="index.html" class="logo"><img src="images/logo.jpg" width="255" height="36" alt="" /></a><br />
<div class="tp_navbg">
<a href="index.html">Home</a>
<a href="inner.html">Upload</a>
<a href="#">Videos</a>
<a href="#">Channels</a>
<a href="#">News</a>
</div>
<div class="tp_smlgrnbg">
<span class="tp_sign"><a href="#" class="tp_txt">Sign Up</a>
<span class="tp_divi">|</span>
<a href="#" class="tp_txt">Login</a>
<span class="tp_divi">|</span>
<a href="#" class="tp_txt">Help</a></span>
</div>
<div class="tp_barbg">
<input name="#" type="text" class="tp_barip" />
<select name="#" class="tp_drp"><option>Videos</option></select>
<a href="#" class="tp_search"><img src="images/tp_search.jpg" width="52" height="24" alt="" /></a>
<span class="tp_welcum">Welcome <b>Guest</b></span>
</div>
</div>
<span class="lp_newvidit1">Video Title</span>
<link rel="stylesheet" type="text/css" href="files/style6.css">
<script type="text/javascript" src="files/jquery-1.js"></script>
<script type="text/javascript" src="files/jquery.js"></script>
<script>
$(document).ready(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&time=today&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" title="'+val.title+'">'+val.title+'</a><br /><img src="'+val.thumbnail.sqDefault+'" width="120" height="90" alt="'+val.title+'"/><br />Views '+val.viewCount+'</div>');
}
});
}
});
});
</script>
否则缩略图排列。像这里 缩略图排成一列,否则......