Blogger的JS函数代码如何调整缩略图的默认分辨率?
How to Resize the Default Resolution of Thumbnails in JS function code for Blogger?
如何在下面的代码中调整缩略图的默认分辨率?使用此代码,我在我的网站上获得了非常低质量的图像。那么,如何使用此代码提高图像质量?
function getPosts(json) {
var posts = "<ul class=mbtlist>";
for (var i = 0; i < json.feed.entry.length; i++) {
var title = json.feed.entry[i].title.$t;
var url = json.feed.entry[i].link.pop().href;
var thumbnail = json.feed.entry[i].media$thumbnail.url;
posts += "<li>" +
"<a class='mbttitle' href='" + url + "'>" +
"<img src='" + thumbnail + "'>" +
title +
"</a>" +
"</li >";
}
posts += '</ul>';
document.getElementById('container').innerHTML = posts;
}
<div id="container"></div>
<script src="https://www.sebahotnews.org/feeds/posts/default/-/জাতীয়?max-results=4&alt=json&callback=getPosts"></script>
<script>
function getPosts(json) {
var posts = "<ul class=mbtlist>";
for (var i = 0; i < json.feed.entry.length; i++) {
var title = json.feed.entry[i].title.$t;
var url = json.feed.entry[i].link.pop().href;
if (json.feed.entry[i].media$thumbnail){thumbUrl = json.feed.entry[i].media$thumbnail.url;thumbnail= thumbUrl.replace("/s72-c/","/s"+400+"/");}
posts += "<li><a class='mbttitle' href='" + url + "'><img src='" + thumbnail + "'>" + title + "</a></li>";
}
posts+='</ul>';
document.getElementById('container').innerHTML = posts;
}
</script>
如何在下面的代码中调整缩略图的默认分辨率?使用此代码,我在我的网站上获得了非常低质量的图像。那么,如何使用此代码提高图像质量?
function getPosts(json) {
var posts = "<ul class=mbtlist>";
for (var i = 0; i < json.feed.entry.length; i++) {
var title = json.feed.entry[i].title.$t;
var url = json.feed.entry[i].link.pop().href;
var thumbnail = json.feed.entry[i].media$thumbnail.url;
posts += "<li>" +
"<a class='mbttitle' href='" + url + "'>" +
"<img src='" + thumbnail + "'>" +
title +
"</a>" +
"</li >";
}
posts += '</ul>';
document.getElementById('container').innerHTML = posts;
}
<div id="container"></div>
<script src="https://www.sebahotnews.org/feeds/posts/default/-/জাতীয়?max-results=4&alt=json&callback=getPosts"></script>
<script>
function getPosts(json) {
var posts = "<ul class=mbtlist>";
for (var i = 0; i < json.feed.entry.length; i++) {
var title = json.feed.entry[i].title.$t;
var url = json.feed.entry[i].link.pop().href;
if (json.feed.entry[i].media$thumbnail){thumbUrl = json.feed.entry[i].media$thumbnail.url;thumbnail= thumbUrl.replace("/s72-c/","/s"+400+"/");}
posts += "<li><a class='mbttitle' href='" + url + "'><img src='" + thumbnail + "'>" + title + "</a></li>";
}
posts+='</ul>';
document.getElementById('container').innerHTML = posts;
}
</script>