View Single Post
Old 06-05-2009, 07:26 AM   #1 (permalink)
superstar2k9
Registered User
 
superstar2k9's Avatar
 
Join Date: Mar 2009
Location: spain ..........ole
Posts: 30
OS: xp home edition 2002 sp2


Send a message via MSN to superstar2k9
java script help

Hi all i have posted a few questions regarding java script i have this script

<script>

//Time of day message script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

var Digital=new Date()
var hours=Digital.getHours()

//Configure message below to your own.
if (hours>=5&&hours<=11) //MESSAGE FOR MORNING
document.write('<b>Welcome to our site. Good morning visitor.</b>')
else if (hours==12) //MESSAGE FOR NOON
document.write('<b>It is high noon. Thanks for dropping by!</b>')
else if (hours>=13&&hours<=17) //MESSAGE FOR AFTERNOON
document.write('<b>Good afternoon, and thanks for visiting.</b>')
else if (hours>=17&&hours<=19) //MESSAGE FOR EVENING (6pm-8pm)
document.write('<b>Good evening. Hope you\'re enjoying the gentle breeze</b>')
else if (hours>=18&&hours<=11) //MESSAGE FOR NIGHT (9pm-11pm)
document.write('<b>Glad to see you this time of the night.</b>')
else //MESSAGE FOR LATE NIGHT, EARLY MORNING (12pm-4am)
document.write('<b>Wow, thanks for choosing to visit our site over sleep!</b>')

</script>



on These line's

else //MESSAGE FOR LATE NIGHT, EARLY MORNING (12pm-4am)
document.write('<b>Wow, thanks for choosing to visit our site over sleep!</b>')

i wish to change it from displaying the message
Wow, thanks for choosing to visit our site over sleep!</
into an image so lets say my image is named will.jpg how would it look

Im guess is something like this

else if (hours>=15&&hours<=16) //MESSAGE FOR NIGHT (15pm-16pm)
} else if (timeNow < 18) {img = 'will.jpg';

PLease help
__________________
All the Gear & no idea
superstar2k9 is offline   Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here