猿问

在脚本中调整图像大小

我如何让这个脚本将图像大小调整为宽度 200 像素高度 90 像素???


我已经对脚本进行了几次调整,但是当我可以将图像调整到我想要的尺寸时,图像质量很糟糕。


谁能知道调整图像大小的变化?


<div id="feed-list-container"></div>


<div style="clear:both;"></div>




<script type="text/javascript">

var multiFeed = {

    feedsUri: [

        {

            name: "Judul Widget 1",

            url: "https://elfenliedbrazil.blogspot.com/",

            tag: ""

        },

        {

            name: "Judul Widget 2",

            url: "",

            tag: ""

        },

        {

            name: "Judul Widget 1",

            url: "",

            tag: ""

        }

    ],

    numPost: 10,

    showThumbnail: true,

    showSummary: true,

    summaryLength: 80,

    titleLength: "auto",

    thumbSize: 200,

    containerId: "feed-list-container",

    readMore: {

        text: "Selengkapnya",

        endParam: "?max-results=20"

    }

};

</script>



<script type='text/javascript'>

//<![CDATA[

// Multi Feed Loader Script by Taufik Nurrohman

// URL: http://www.dte.web.id, https://plus.google.com/108949996304093815163/about

//]]>

</script>


猛跑小猪
浏览 147回答 1
1回答

牛魔王的故事

试试这个<div id="feed-list-container"></div><div style="clear:both;"></div><script type="text/javascript">var multiFeed = {&nbsp; &nbsp; feedsUri: [&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "Judul Widget 1",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: "https://elfenliedbrazil.blogspot.com/",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tag: ""&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "Judul Widget 2",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: "",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tag: ""&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "Judul Widget 1",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: "",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tag: ""&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; ],&nbsp; &nbsp; numPost: 10,&nbsp; &nbsp; showThumbnail: true,&nbsp; &nbsp; showSummary: true,&nbsp; &nbsp; summaryLength: 80,&nbsp; &nbsp; titleLength: "auto",&nbsp; &nbsp; thumbSize: 200,&nbsp; &nbsp; containerId: "feed-list-container",&nbsp; &nbsp; readMore: {&nbsp; &nbsp; &nbsp; &nbsp; text: "Selengkapnya",&nbsp; &nbsp; &nbsp; &nbsp; endParam: "?max-results=20"&nbsp; &nbsp; }};</script><script>/*<![CDATA[*/var mf_defaults = {&nbsp; feedsUri: [{&nbsp; &nbsp; name: "Posting JQuery",&nbsp; &nbsp; url: "http://www.dte.web.id",&nbsp; &nbsp; tag: "JQuery"&nbsp; }, {&nbsp; &nbsp; name: "Posting CSS",&nbsp; &nbsp; url: "http://www.dte.web.id",&nbsp; &nbsp; tag: "CSS"&nbsp; }, {&nbsp; &nbsp; name: "Widget-Widget Blogger",&nbsp; &nbsp; url: "http://www.dte.web.id",&nbsp; &nbsp; tag: "Widget"&nbsp; }],&nbsp; numPost: 4,&nbsp; showThumbnail: true,&nbsp; showSummary: true,&nbsp; summaryLength: 80,&nbsp; titleLength: "auto",&nbsp; thumbSize: 200,&nbsp; thumbWidth: 200, // new setting&nbsp; thumbHeight: 90, // new setting&nbsp; newTabLink: false,&nbsp; containerId: "feed-list-container",&nbsp; listClass: "list-entries",&nbsp; readMore: {&nbsp; &nbsp; text: "More",&nbsp; &nbsp; endParam: "?max-results=20"&nbsp; },&nbsp; autoHeight: false,&nbsp; current: 0,&nbsp; onLoadFeed: function(a) {},&nbsp; onLoadComplete: function() {},&nbsp; loadFeed: function(c) {&nbsp; &nbsp; var d = document.getElementsByTagName("head")[0],&nbsp; &nbsp; &nbsp; a = document.getElementById(this.containerId),&nbsp; &nbsp; &nbsp; b = document.createElement("script");&nbsp; &nbsp; b.type = "text/javascript";&nbsp; &nbsp; b.src = this.feedsUri[c].url + "/feeds/posts/summary" + (this.feedsUri[c].tag ? "/-/" + this.feedsUri[c].tag : "") + "?alt=json-in-script&max-results=" + this.numPost + "&callback=listEntries";&nbsp; &nbsp; d.appendChild(b)&nbsp; }};for(var i in mf_defaults) {&nbsp; mf_defaults[i] = (typeof(multiFeed[i]) !== undefined && typeof(multiFeed[i]) !== "undefined") ? multiFeed[i] : mf_defaults[i]}function listEntries(q) {&nbsp; var p = q.feed.entry,&nbsp; &nbsp; c = mf_defaults,&nbsp; &nbsp; h = document.getElementById(c.containerId),&nbsp; &nbsp; a = document.createElement("div"),&nbsp; &nbsp; d = "",&nbsp; &nbsp; l = c.feedsUri.length,&nbsp; &nbsp; n, k, m, g;&nbsp; for(var f = 0; f < c.numPost; f++) {&nbsp; &nbsp; if(f == p.length) {&nbsp; &nbsp; &nbsp; break&nbsp; &nbsp; }&nbsp; &nbsp; n = (c.titleLength !== "auto") ? p[f].title.$t.substring(0, c.titleLength) + (c.titleLength < p[f].title.$t.length ? "&hellip;" : "") : p[f].title.$t;&nbsp; &nbsp; m = ("summary" in p[f]) ? p[f].summary.$t.replace(/<br ?\/?>/g, " ").replace(/<.*?>/g, "").replace(/[<>]/g, "") : "";&nbsp; &nbsp; m = (c.summaryLength < m.length) ? m.substring(0, c.summaryLength) + "&hellip;" : m;&nbsp; &nbsp; g = ("media$thumbnail" in p[f]) ? '<img src="' + p[f].media$thumbnail.url.replace(/\/s72(\-c)?\//, "/w" + c.thumbWidth + "-h" + c.thumbHeight + "-c/") + '" style="width:' + c.thumbWidth + "px;height:" + c.thumbHeight + 'px;">' : '';&nbsp; &nbsp; for(var e = 0, b = p[f].link.length; e < b; e++) {&nbsp; &nbsp; &nbsp; k = (p[f].link[e].rel == "alternate") ? p[f].link[e].href : "#"&nbsp; &nbsp; }&nbsp; &nbsp; d += '<div class="post hentry"' + (!c.autoHeight ? ' style="height' + c.thumbHeight + 'px;overflow:hidden;"' : "") + ">";&nbsp; &nbsp; d += (c.showThumbnail) ? g : "";&nbsp; &nbsp; d += '<div class="post-title entry-title"><a href="' + k + '"' + (c.newTabLink ? ' target="_blank"' : "") + ">" + n + "</a></div>";&nbsp; &nbsp; d += '<div class="summary">';&nbsp; &nbsp; d += "<span" + (!c.showSummary ? ' style="display:none;"' : "") + ">";&nbsp; &nbsp; d += (c.showSummary) ? m : "";&nbsp; &nbsp; d += "</span></div>";&nbsp; &nbsp; d += '<span style="display:block;clear:both;"></span></div>'&nbsp; }&nbsp; d += "";&nbsp; d += '<div class="more-link"><a href="' + c.feedsUri[c.current].url.replace(/\/$/, "") + "/search/label/" + c.feedsUri[c.current].tag + c.readMore.endParam + '"' + (c.newTabLink ? ' target="_blank"' : "") + ">" + c.readMore.text + "</a></div>";&nbsp; a.className = c.listClass;&nbsp; a.innerHTML = '<div class="main-title"><h4>' + c.feedsUri[c.current].name + "</h4></div>" + d;&nbsp; h.appendChild(a);&nbsp; c.onLoadFeed(c.current);&nbsp; if((c.current + 1) < l) {&nbsp; &nbsp; c.loadFeed(c.current + 1)&nbsp; }&nbsp; if((c.current + 1) == l) {&nbsp; &nbsp; c.onLoadComplete()&nbsp; }&nbsp; c.current++}mf_defaults.loadFeed(0);/*]]>*/</script>改变: /s"+c.thumbSize+"-c/以/w" + c.thumbWidth + "-h" + c.thumbHeight + "-c/和其他一些c.thumbSize出现的代码
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答