|
Post by MonsterControl on Jan 19, 2012 22:07:02 GMT -4
<script type="text/javascript"> <!-- /* set max posted image size with scrollbars for larger by Death to ALL edit the maxWidth and maxHeight for the max size of images posted, will also be the size of the iframe for larger images. */ var maxWidth=750; var maxHeight=750; var img=document.getElementsByTagName("img");
for(s=0;s<img.length;s++) { if (img[s].alt.match(/\[image\]/i)) { img[s].onload = function() { if (this.width>maxWidth || this.height>maxHeight) { var iFrame = document.createElement("iframe"); iFrame.src = this.src; var iFrameWidth = maxWidth; if (this.width<maxWidth) { iFrameWidth = this.width; } iFrame.width = iFrameWidth; var iFrameHeight = maxHeight; if (this.height<maxHeight) { iFrameHeight = this.height; } iFrame.height = iFrameHeight; iFrame.frameBorder = "0"; iFrame.noResize = "true"; iFrame.scrolling = "auto"; iFrame.style.display = "block"; iFrame.marginHeight = "0"; iFrame.marginWidth = "0"; this.parentNode.replaceChild(iFrame, this); } } } if((img[s].width>maxWidth || img[s].height>maxHeight) && img[s].alt.match(/\[image\]/i)) { var iFrame = document.createElement("iframe"); iFrame.src = img[s].src; var iFrameWidth = maxWidth; if (this.width<maxWidth) { iFrameWidth = this.width; } iFrame.width = iFrameWidth; var iFrameHeight = maxHeight; if (this.height<maxHeight) { iFrameHeight = this.height; } iFrame.height = iFrameHeight; iFrame.frameBorder = "0"; iFrame.noResize = "true"; iFrame.scrolling = "auto"; iFrame.style.display = "block"; iFrame.marginHeight = "0"; iFrame.marginWidth = "0"; img[s].parentNode.replaceChild(iFrame,img[s]); } } // --> </script>
|
|