otomatik id |
10 Mesajlar | 1.292 Okunma |
for($i=1;$i<=25;$i++){
echo '
';
} ?>
$numb = 1;
while ( $numb >= 25 ) {
echo ' ';
$numb++;
}?>
function tplawesome(e,t){res=e;for(var n=0;n
$(function() {
$("#formm").on("submit", function(e) {
e.preventDefault();
// prepare the request
var request = gapi.client.youtube.search.list({
part: "snippet",
type: "video",
q: encodeURIComponent($("#note-textarea").val()).replace(/%20/g, "+"),
maxResults: 24,
order: "viewCount",
publishedAfter: "2000-01-01T00:00:00Z"
});
// execute the request
request.execute(function(response) {
var results = response.result;
$("#results").html("");
$.each(results.items, function(index, item) {
$.get("tpl/item.php", function(data) {
$("#results").append(tplawesome(data, [{"title":item.snippet.title, "videoid":item.id.videoId}]));
});
});
resetVideoHeight();
});
});
$(window).on("resize", resetVideoHeight);
});
function resetVideoHeight() {
$(".video").css("height", $("#results").width() * 9/16);
}
function init() {
gapi.client.setApiKey("*****************************");
gapi.client.load("youtube", "v3", function() {
// yt api is ready
});
}
<script>
var list = document.getElementsByClassName("something");
for (var i = 0; i < list.length; i++) {
list[i].setAttribute("id", "box" + i);
}
</script>