Active Desktop Curiosity Question (Speedy_B Would Love this :P)

C:\Active Desktop\New Active Desktop\Wallpapers\Wallpaper1.jpg

-----------

Do i have to put this anywhere onto the HTML active desktop script?

NO


This is what it should be...



PHP:
<script language="javascript" type="text/javascript">

var randomNumber=Math.floor(Math.random()*7)

document.body.background="Wallpapers\Wallpaper" + randomNumber + ".jpg"

</script>
 
<script language="javascript" type="text/javascript">

var randomNumber=Math.floor(Math.random()*7)

document.body.background="Wallpapers\Wallpaper" + randomNumber + ".jpg"

</script>

Like this, the php tag that Un4gIvEn1 used made it so one of the slashes got removed, just copy and paste this and it should work for you.
 
The only thing I can think of is that its still not getting to the correct folder where your wallpapers are being stored...I dunno...:confused:

I'll post back in a bit, I'm going to make up a quick little example and zip it up so you can have a look.
 
Ok, hopefully this clears up some things.

First of all this is the code you are going to want to use, try copying this in before you even bother with my attachment. This has some slight changes and should work better for you.

<script language="javascript" type="text/javascript">

var randomNumber=Math.floor(Math.random()*8)

document.body.background="Wallpapers/Wallpaper" + randomNumber + ".jpg"

</script>

Changes: '\' replaced with '/' and 7 replaced with 8

The 7 was replaced with 8 because you need to use add one to the number of images you have, so if you have Wallpaper11 as your highest, you would use 12 in the random number calculation.

If this doesn't work, take a look at my attachment, because it has a working example you could use.

Good Luck,
Blitz
 
Here ya go, in the raw.
Code:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script LANGUAGE="JavaScript">
<!--
current = 0;
layName='test';

// Hour * 60 * 60 + Minute * 60 + Sec
time1 = 4 * 60 * 60;	// dawn
time2 = 10 * 60 * 60;	// daytime
time3 = 16 * 60 * 60;	// sunset
time4 = 20 * 60 * 60;	// midnight 
// current display images Number.
disp = 0;

function setBG() {
	now = new Date();
	h = now.getHours();
	m = now.getMinutes();
	s = now.getSeconds();

	time = s + m * 60 + h * 60 * 60;	// date to sec trans.

	if (time > time4) {
		if (document.all && disp != 5) {
			document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/midnight16bit1280x1024.bmp")';
			disp = 5;
		}
	}
	else
	if (time > time3) {
		if (document.all && disp != 4) {
			document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/sunset16bit1280x1024.bmp")';
			disp = 4;
		}
	} else if (time > time2) {
		if (document.all && disp != 3) {

			document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/daytime16bit1280x1024.bmp")';
			disp = 3;
		}
	} else if (time > time1) {
		if (document.all && disp != 2) {

			document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/dawn16bit1280x1024.bmp")';
			disp = 2;
		}
	}
	else {
		if  (document.all && disp != 5) {
			document.all(layName).style.backgroundImage='url("c:/Program Files/Sony/VAIOwallpaper/midnight16bit1280x1024.bmp")';
			disp = 5;
		}
	}
		setTimeout('setBG()', 60000);
}

// -->
</script>

<title>Welcome</title>
</head>

<body onLoad="setBG()" topmargin="0" leftmargin="0" bgcolor="#A6CAF0">
<div ID="test"
STYLE="position:absolute;left:0px;top:0px;
width:1280;height:1024;clip:(0,1280,1024,0)"></div>
</body>
</html>
:rolleyes:
 
damnit... an emoticon displayed in the last few lines o code... the vb code /code fxn is supposed to override that. :mad:

Oh well, anyone interested will figure it out. :D
 
i havent tried anything new yet but i like the sound and idea of your raw file with those wallpapers.. and chance you cud post the wallpapers for lil ol' me? :D or even e-mail them me?

alex_is_axel2002@gmx.net

thank you in advance :cool:
 
Originally posted by Alex_is_Axel
i havent tried anything new yet but i like the sound and idea of your raw file with those wallpapers.. and chance you cud post the wallpapers for lil ol' me? :D or even e-mail them me?

alex_is_axel2002@gmx.net

thank you in advance :cool:

Can do, but are ya sure you want them? They have the Vaio logo. :) Never too the time to edit that nonsense out.

Speaking of Vaio....need to put my SR7K up on Ebay soon. My Inspiron 8200 took its place long ago.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,623
Latest member
AndersonLo
Back