Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Dec 17th, 2017, 9:16pm


Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Google
Dynamic Drive

The Staff
Roger
Dave
GIzzy



« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Reduce size of images in posts  (Read 5988 times)
Garet
Conforums Elite
Senior Member


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 2070
xx Reduce size of images in posts
« Thread started on: Aug 19th, 2006, 03:59am »

Ok, this code will reduce the size of images in posts that are over a specified height and width.

Code submitted by: Zando

Place this code in your Board Footers

It is Cross-Browser in FF & IE

Edit the colors

Read below code for more instructions.


<script type="text/javascript">
<!--

/* ~~~~~~~~~~~~~~~~~~ *\
Reduce size of Images In Posts.
\* ~~~~~~~~~~~~~~~~~~ */

var wid="1280"; //Maximum Width
var hei="768"; //Maximum Heigth
var red="2"; //Number the size of the image will be divided by

var tdz=document.getElementsByTagName("td")
for(a=0;a<tdz.length;a++){
if(tdz[a].className.match(/windowbg2|windowbg/) && tdz[a].vAlign=="top" && tdz[a].width=="80%"){
var pic=tdz[a].getElementsByTagName("img")
for(z=0;z<pic.length;z++){
if(pic[z].width>=wid && pic[z].height>=hei){
var url=pic[z].src
var hi=pic[z].height;var wi=pic[z].width;
var hi2=hi/red;var wi2=wi/red;
pic[z].height=hi2;pic[z].width=wi2
}
}
}
}

//-->
</script>


Only secition of the code that needs editing is this part.
var wid="1280"; //Maximum Width
var hei="768"; //Maximum Heigth
var red="2"; //Number the size of the image will be divided by


Anything above or equal to 1280 in width and anything above or equal to 768 in height will have it size divided by 2
« Last Edit: Dec 29th, 2008, 11:12am by Dave » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls