Page 1 of 11
uCause Community » Trash & Archives » Forum » Image resize (script)
Image resize
MeepDate: Wednesday, 2011-12-14, 12:30 PM | Message # 1
Member
Group: Senior Members
Messages: 28
Awards: 0
Reputation: 1
Status: :-(
1, Open up your Control Panel
2, Go to the forum section
3, Open Customize design
4, General appearance of forum pages

Your angry due to the images are braking your forum layout

V1

Place this code inside the <head> tag:
Code
<script type="text/javascript">
function countImgs(maxHeight, maxWidth)
{
       var img = document.images;

       for (var i = 0; i < img.length; i++) {

          if (img[i].height > maxHeight)
             img[i].height = maxHeight;
                  
          if (img[i].width > maxWidth)
             img[i].width = maxWidth;
       }
}
</script>


this function will take two arguments, the max height and max width and compare EVERY image in the document with these values and resize them if they excede them.

to call the function automatically add the onload event in <body> tag like:

Code
<body onload="countImgs(640, 480);">

tags-zB11Image, resize

v2

You may notice the images you or user are posting are looking abit werid

Place this code inside the <head> tag:

Code
<script type="text/javascript">
function countImgs(maxWidth)
{
   var img = document.images;

   for (var i = 0; i < img.length; i++) {
   if (img[i].width > maxWidth)
   img[i].width = maxWidth;
   }
}
</script>


this function will take two arguments, the max height and max width and compare EVERY image in the document with these values and resize them if they excede them.

to call the function automatically add the onload event in <body> tag like:

Code
<body onload="countImgs(480);">


Message edited by Meep - Wednesday, 2011-12-14, 12:31 PM
 
0 Thanked you For This Useful Post:
SirDarknight(Tonmoy)Date: Thursday, 2011-12-15, 7:50 AM | Message # 2
Member
Group: Senior Members
Messages: 894
Awards: 10
Reputation: 15
Status: :-(
Good job

Please Give Me A Award or + Rep If My Post Helps You

Please Give Me A Award or + Rep If You Like my Scripts
 
0 Thanked you For This Useful Post:
uCause Community » Trash & Archives » Forum » Image resize (script)
Page 1 of 11
Search:


"Making uCoz web designs simple and easy to use"
- uCause Developers