|
Post by Smangii Posting Profile on Nov 29, 2010 18:01:27 GMT -6
Scales images in posts and signatures.
Goes in Global Footer
<script> //Scale Large Images in Posts and Signatures v1.0 //Copyright 10-19-2005 ~Wonder //May be reposted anywhere as long as this header remains in tact
//Enter Max Height/Width of images maxPostHeight=200; maxPostWidth=200; maxSigHeight=200; maxSigWidth=200;
if(location.href.match(/action=(display|goto|viewprofile|pmview|recent)/)) { td = document.getElementsByTagName("td"); server=location.href.split(".com")[0]; for(i = 0; i < td.length; i ++) { if(td[i].innerHTML.match(/(« Reply #\d)|(« Thread Started on )/) && td[i].getElementsByTagName("img").length==0) { temp=td[i].parentNode.nextSibling.getElementsByTagName("img"); for(j=0;j<temp.length;j++) { temp[j].onload=resizePostImage; } } if (td[i].className.match("windowbg") && td[i].align=="left" && td[i].vAlign=="bottom" && td[i].lastChild.nodeName=="FONT") { temp=td[i].lastChild.getElementsByTagName("img"); for(j=0;j<temp.length;j++) { temp[j].onload=resizeSigImage; } } } }
function resizePostImage() { if(this.height>maxPostHeight){this.width=Math.round((maxPostHeight/this.height)*this.width);this.height=maxPostHeight ;} if(this.width>maxPostWidth){this.height=Math.round((maxPostWidth/this.width)*this.height);this.width=maxPostWidth;} } function resizeSigImage() { if(this.height>maxSigHeight){this.width=Math.round((maxSigHeight/this.height)*this.width);this.height=maxSigHeight;} if(this.width>maxSigWidth){this.height=Math.round((maxSigWidth/this.width)*this.height);this.width=maxSigWidth;} } </script>
|
|