View Full Version : Special Wallpaper View Script!!!


Stormx
06-25-2003, 05:22 PM
I am just posting this script to see if anyone finds it helpfull! It randomizes a wallpaper thumbnail it shows and ajusts the links acordingly!

It also detects your screen width and sets that up too!

Insert this into your body part of your page where you want it to appear:

-----------------------------------------------------------------------------------

<script LANGUAGE="JavaScript">
////////////////////////////////////////////////////
//This script was created by stormx!//////
//Please leave this part here///////////////
///////////////////////////////////////////////////
// This is the amount of images that you have
multi = 5
//No need edit the next section
//This line gets the random number
yay=(Math.random() * multi-1)+1;
//This line rounds it to the nearest interger
i=Math.round(yay);

//Here we detect the screen height and width
screenx=screen.width;
screeny=screen.height;

//This is where it all comes together
//If you are editing this part, please use a apostraphy (') in the HTML parts rather than a quote mark (")
//This avoids errors and is ESSENTIAL
document.write ("<a href='image" + i + "size" + screenx + "x" + screeny + ".jpg' target='_blank'><img src='image" + i + "thumb.jpg' border='0' ></a>");

</script>

----------------------------------------------------------------------------------

OK, a few words

1.) When editing the document.write part please use a apostraphy (') in the HTML parts rather than a quote mark (")

2.) If you want to add something else to it, such as an info page fot that wallpaper- to detect the random numer we generated add in where you want the number

" + i + "

3.) Your images should be:

image#thumb.jpg
image#size800x600.jpg
image#size1024x768.jpg
image#size128-x1024.jpg]

natuaral replacing # with your image number