PDA

View Full Version : 'Thumb' sizes instead of 'Tiny' for category browsing ?


gaurawa
Jan-27-2010, 09:59 PM
I searched but didn't find a way to get 'Thumb' view instead of 'Tiny' views in category browsing unless the # of categories is less than 5.

What if I use a javascript to replace 'Tiny' with 'Thumb' ? Will that work reliably ?

something like:

function ReplaceTinyThumb() {
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++) {
old_src = imgTags[i].src ;
imgTags[i].src= old_src.replace("Tiny", "Thumb") ;
}
}

edited to add link for my galleries page: http://www.gaurawa.com/galleries

thanks,
Gaurawa

gaurawa
Feb-04-2010, 02:25 PM
..did some change to the code to avoid changing all img tags. It should change only the tiny thumbnails.

function ReplaceTinyThumb() {
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++) {
var old_src = imgTags[i].src ;
var re = /Tiny/ ;
if(re.test(old_src)) {
imgTags[i].src= old_src.replace("Tiny", "Thumb") ;
}
}
}

jfriend
Feb-04-2010, 03:42 PM
..did some change to the code to avoid changing all img tags. It should change only the tiny thumbnails.

function ReplaceTinyThumb() {
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++) {
var old_src = imgTags[i].src ;
var re = /Tiny/ ;
if(re.test(old_src)) {
imgTags[i].src= old_src.replace("Tiny", "Thumb") ;
}
}
} It is more complicated than this because if you feature a photo, then the img tag has the size of the image in it too so you have to scale the size tags. And, the CSS has to change so it will layout properly at a different size. I've been working on this issue for awhile and am not done yet.

gaurawa
Feb-04-2010, 07:20 PM
I will wait for you fix then :D

Since I don't have any featured photos ( all pick random pics ), it's seems to work for me in the meantime.