Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-12-2002, 04:18 AM   PM User | #1
Rockrz
New Coder

 
Join Date: Aug 2002
Location: Here I am, is Where I'm at!
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rockrz is an unknown quantity at this point
How to change font within a JS script

Anyone have any idea about how I can control the font in the following date script? It now appears as 'New Times Roman' and I'd like for it to be arial like the text on all my pages.

Here's the script:

Quote:
<!--
// Displays appropriate greeting based on hours of day.
now = new Date();
if (now.getHours() < 12)
document.write("Good Morning, Today is ");
else if (now.getHours() < 17)
document.write("Good Afternoon, Today is ");
else document.write("Good Evening, Today is ");
var today = new Date();
var browser = navigator.appName;
months = new Array( "January","February","March","April","May","June","July","August","September","October","November"," December" );
document.writeln( months[ today.getMonth() ] + " " + today.getDate() + ", " + ( (browser != "Netscape" ) ? today.getYear() : today.getYear() + 1900 ) );
//-->
__________________
Adopt a siggy!
Your Message Here....
Rockrz is offline   Reply With Quote
Old 12-12-2002, 05:39 AM   PM User | #2
cheesebagpipe
Regular Coder

 
Join Date: Nov 2002
Posts: 596
Thanks: 0
Thanked 0 Times in 0 Posts
cheesebagpipe is an unknown quantity at this point
maybe...

<!--
// Displays appropriate greeting based on hours of day.
document.write('<span style="font:200 12px arial;color:brown;">');
now = new Date();
if (now.getHours() < 12)
............
............
today.getYear() : today.getYear() + 1900 ) );
document.write('</span>');
cheesebagpipe is offline   Reply With Quote
Old 12-12-2002, 03:15 PM   PM User | #3
Rockrz
New Coder

 
Join Date: Aug 2002
Location: Here I am, is Where I'm at!
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rockrz is an unknown quantity at this point
You Da Man!!!

That works perfectly. In fact, it even works in NS4!
Thanks for the tip . . .
__________________
Adopt a siggy!
Your Message Here....
Rockrz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 01:34 AM.


Advertisement
Log in to turn off these ads.