Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   day and night (http://www.programmingforums.org/showthread.php?t=5227)

coldblue Aug 2nd, 2005 3:51 PM

day and night
 
i was wondering if you could make a script that when it's day i have a light background on my page and when it's night i get a dark backgorund

so something that gets trigered by the time so from 6am to 8pm it's light then from 8pm back to 6am it's dark

could this be possible like changing the background picture or something :confused:

OpenLoop Aug 2nd, 2005 4:52 PM

Quote:

Originally Posted by coldblue
i was wondering if you could make a script that when it's day i have a light background on my page and when it's night i get a dark backgorund

so something that gets trigered by the time so from 6am to 8pm it's light then from 8pm back to 6am it's dark

could this be possible like changing the background picture or something :confused:

can you provide more information. What "page" are you talking about, Your desktop, your website, the page in your math book :D.

thechristelegacy Aug 2nd, 2005 7:19 PM

I know it's possible, but not sure how. There are functions of course to get the time of the user, and according to that time you should be able to change the page however you want.

DaWei Aug 2nd, 2005 8:01 PM

Change the background color of whatever element you like. I presume, possibly incorrectly, you're talking HTML page.

coldblue Aug 2nd, 2005 11:31 PM

Quote:

Originally Posted by OpenLoop
can you provide more information. What "page" are you talking about, Your desktop, your website, the page in your math book :D.

:D webpage lol

more info : well say i had a clock on my page or it goes by computer user time when it reaches the right time it will should different backgrounds and things of the page different possible :confused: if so just post the code i'm a computer wiz i no wot i'm doing lol :D

Berto Aug 3rd, 2005 2:03 AM

If you are a computer wiz you should be able to work it out?

coldblue Aug 3rd, 2005 3:09 AM

i'm good at computers but i hate javascript programing cos i get stressed with it so i want help DUR!! i good at other programming but not java

Berto Aug 3rd, 2005 4:15 AM

The other thing was dont cross post.

coldblue Aug 3rd, 2005 5:35 AM

Hey people i've got a code now that works very well it uses your computer clock for timeing

Code:
<script language="JavaScript">
<!--
var now = new Date( );
var hour = now.getHours( );
if (hour >= 4 && hour <= 18) {
document.bgColor = "#6699cc";
}
else {
document.bgColor = "#000066";
}
//-->
</script>

DaWei Aug 3rd, 2005 5:57 AM

We all knew a self-proclaimed wiz was just testing us. Wasn't too stressful now, was it?


All times are GMT -5. The time now is 6:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC