Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Day/Night Website Effect
Old 04-18-2005, 04:52 PM Day/Night Website Effect
Junior Talker

Posts: 2
Trades: 0
Is there an easy way to have images changed based on the person's computer clock? for example, I want to display an image during the morning, another during the evening, and then another at night. I'm not exactly sure what I need to use, but would love to just do plain HTML. THANKS!
monorail_driver is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-18-2005, 06:20 PM
drewrockshard's Avatar
Super Talker

Posts: 100
Name: Drew
Location: Garland (Dallas), Texas
Trades: 0
when you want user interaction, especially something like this, nothing is going to just happen with html. you would have to use some sort of object oriented programming langauage such as javascript or php, or something along that effect.
__________________
Best Regards,
Drew Decker

Please login or register to view this content. Registration is FREE
drewrockshard is offline
Reply With Quote
View Public Profile
 
Old 04-18-2005, 06:21 PM
ppedersen's Avatar
Super Talker

Posts: 115
Location: Tampa Bay, FL - USA
Trades: 0
Here's some JavaScript that will do it. Just add your image tag into the document.write

Code:
	<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
	<!-- Hide script from old browsers

	now = new Date

	if (now.getHours() < 5) {
		document.write("What are you doing up so late?")
	}
	else if (now.getHours() < 9) {
		document.write("Good Morning!")
	}
	else if (now.getHours() < 17) {
		document.write("No surfing during working hours!")
	}
	else {
		document.write("Good Evening!")
	}

	// End hiding script from old browsers -->
	</SCRIPT>
Code is from: http://www.chalcedony.com/javascript3e/
__________________

Please login or register to view this content. Registration is FREE
(
Please login or register to view this content. Registration is FREE
)

Please login or register to view this content. Registration is FREE
's Website
ppedersen is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 07:01 AM
iota's Avatar
Novice Talker

Posts: 13
Trades: 0
Ok, so the code that monorail_driver want will be


Code:
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
	<!-- Hide script from old browsers

	now = new Date

	if (now.getHours() < 12) {
		document.write("<img src='img1.jpg'>")
	}
	else if (now.getHours() < 16) {
		document.write("<img src='img2.jpg'>")
	}
	else if (now.getHours() < 24) {
		document.write("<img src='img3.jpg'>")
	}
	else {
		document.write("<img src='img4.jpg'>")
	}

	// End hiding script from old browsers -->
	</SCRIPT>
__________________


Please login or register to view this content. Registration is FREE


iota is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Day/Night Website Effect
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22901 seconds with 12 queries