Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 2nd, 2005, 4:51 PM   #1
coldblue
Newbie
 
Join Date: May 2005
Posts: 20
Rep Power: 0 coldblue is on a distinguished road
Exclamation 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
coldblue is offline   Reply With Quote
Old Aug 2nd, 2005, 5:52 PM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
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
can you provide more information. What "page" are you talking about, Your desktop, your website, the page in your math book .
OpenLoop is offline   Reply With Quote
Old Aug 2nd, 2005, 8:19 PM   #3
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
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.
thechristelegacy is offline   Reply With Quote
Old Aug 2nd, 2005, 9:01 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Change the background color of whatever element you like. I presume, possibly incorrectly, you're talking HTML page.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 3rd, 2005, 12:31 AM   #5
coldblue
Newbie
 
Join Date: May 2005
Posts: 20
Rep Power: 0 coldblue is on a distinguished road
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 .
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 if so just post the code i'm a computer wiz i no wot i'm doing lol
coldblue is offline   Reply With Quote
Old Aug 3rd, 2005, 3:03 AM   #6
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
If you are a computer wiz you should be able to work it out?
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Aug 3rd, 2005, 4:09 AM   #7
coldblue
Newbie
 
Join Date: May 2005
Posts: 20
Rep Power: 0 coldblue is on a distinguished road
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
coldblue is offline   Reply With Quote
Old Aug 3rd, 2005, 5:15 AM   #8
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
The other thing was dont cross post.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Aug 3rd, 2005, 6:35 AM   #9
coldblue
Newbie
 
Join Date: May 2005
Posts: 20
Rep Power: 0 coldblue is on a distinguished road
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>
coldblue is offline   Reply With Quote
Old Aug 3rd, 2005, 6:57 AM   #10
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
We all knew a self-proclaimed wiz was just testing us. Wasn't too stressful now, was it?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:46 AM.

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