vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Resize Images In Posts
Resize Images In Posts - Posted By Michael (wrighty) on 15th May 08 at 8:54pm
This code will make it so that images in posts are resized to a size you specify, unless it's smaller than the specified size.
<script>
/*Resize Images in Posts
Created By Wrighty*/
var size = 300;
var x = get('td','tag');
for(c=0; c<x.length; c++){
if(x[c].className == 'post' && x[c].getElementsByTagName('img')){
var f = x[c].getElementsByTagName('img');
for(y=0;y<f.length;y++){
if(f[y].width > size){
f[y].width = size;
}
if(f[y].height > size){
f[y].height = size;
}
}
}
}
</script>
Global Footer
Re: Resize Images In Posts - Posted By Alex Bailey (system) on 2nd Aug 08 at 7:46pm
I've tried and it doesn't resize
Re: Resize Images In Posts - Posted By Michael (wrighty) on 2nd Aug 08 at 8:48pm
link to an example post?
Re: Resize Images In Posts - Posted By Alex Bailey (system) on 2nd Aug 08 at 10:20pm
I can't show you a link sorry
Maybe its a clash with another code thats not making it work
Re: Resize Images In Posts - Posted By Michael (wrighty) on 2nd Aug 08 at 11:49pm
i can't help unless I have a link so I wouldn't know.
Re: Resize Images In Posts - Posted By Alex Bailey (system) on 3rd Aug 08 at 12:04am
Well tbh a link wouldn't do anyway as its in MM
Re: Resize Images In Posts - Posted By Michael (wrighty) on 3rd Aug 08 at 12:05pm
Can't help then. sorry
Re: Resize Images In Posts - Posted By Marc (cr0w) on 4th Aug 08 at 1:35am
System, if you go ahead and PM me the link I can look into what could be causing the issue.
Re: Resize Images In Posts - Posted By Alex Bailey (system) on 4th Aug 08 at 4:11pm
Thanks marc but wrighty now knows the link