Re: probleme with thumbnail size s72-c and img

Vicky <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
You cannot resize thumbnail in Blogger template, but you can do this using 
JavaScript. For example, instead of your code use:
<span expr:data-thumbnail='data:post.thumbnail'></span>

Then, before </body> add (or better include JavaScript file):
(function () {

var nodes = document.getElementsByTagName('span');
for (var i = 0; i < nodes.length; i++) {

var url = nodes[i].getAttribute('data-thumbnail');

if (url) {

var thumb = new Image();

thumb.src = url.replace('/s72-c/', '/s400-c/');

nodes[i].appendChild(thumb);

}

}

})();

ps. For better performance, add an unique id for widget wrapper and instead 
of document.getElementsByTagName('span') use 
document.getElementById('thumbnails-wrapper').getElementsByTagName('span')


marți, 24 iunie 2014, 15:21:56 UTC+3, Nadhir Boukhenifra a scris:
>
> hi i went to resize the thumbnail img size from *s72-c to *
>
>
>
> *s400-cin this code      <img alt='' border='0' 
> expr:height='data:thumbnailSize' expr:src='data:post.thumbnail' 
> expr:width='data:thumbnailSize'/>*
>

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.