/    Sign up×
Community /Pin to ProfileBookmark

Changing font in menu script

I’m putting together a site for a friend, and I’m having difficulty with the font in the menu script. She REALLY wants to use “Papyrus” as the font, especially in the menu script. I thought I had figured it out, having embedded the font in the page and edited the .js file, because it worked in FrontPage, but when I uploaded it to the net, the font doesn’t show up in the menus.

The page is here: [url]http://www.isara-creations.com/mehndi1/[/url]

Any ideas or suggestions?

Thanks!

PS: I’m still really new to Javascript ๐Ÿ˜ฎ

to post a comment
JavaScript

8 Comments(s) โ†ด

Copy linkTweet thisAlerts:
@PittimannFeb 10.2005 โ€”ย Hi!

Just a quick shot: you play with the css in your home1.htm and you seem to assign correct stuff in your js file, but the file actually containing the menu lacks the css.

Hope that helps.

Cheers - Pit
Copy linkTweet thisAlerts:
@kimberlilyauthorFeb 11.2005 โ€”ย Thanks for the tip... small problem though. I've never used css... what do I need to do?

Like I said, I'm new to Javascript ?
Copy linkTweet thisAlerts:
@FangFeb 11.2005 โ€”ย This is where it goes and how it works:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>css font</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
<!--
// all JavaScript here

//-->
</script>

<style type="text/css">
<!--
/* cascading style sheet */
body, html {font-family:Papyrus, 'Papyrus LET', 'Comic Sans MS', sans-serif;}
-->
</style>

</head>
<body>
<p>AaBbCcDdEeFfGgHhIiJj</p>
</body>
</html>

The font-family gives a list of preferred fonts.

Starting with Papyrus , not available on win XP

'Papyrus LET' , XP font but illegible

'Comic Sans MS' , similar to Papyrus

sans-serif , the default font if nothing else is available
Copy linkTweet thisAlerts:
@PittimannFeb 11.2005 โ€”ย Hi![i]Originally posted by kimberlily [/i]

[B]Thanks for the tip... small problem though. I've never used css... what do I need to do?



Like I said, I'm new to Javascript ? [/B]
[/QUOTE]
Something like Fang suggested and like you already did in the file being displayed in the iframe. Your external .js file is already assigning Papyrus at the two relevant spots:

'...this.hdrFontFamily=" Papyrus;...' and '...this.itmFontFamily=" Papyrus;...'

Cheers - Pit
Copy linkTweet thisAlerts:
@FangFeb 11.2005 โ€”ย Your font embedding only works in IE and the menu does not work in Firefox
Copy linkTweet thisAlerts:
@kimberlilyauthorFeb 12.2005 โ€”ย I was afraid the embedding would only work in IE. I can't find the necessary software to convert the font into a format that is compatible with all browsers (not for free, anyway).

Does Javascript not work in Firefox then? Or does something need to be done to the script to make it work in Firefox? I have used the same menu on another webpage I put together, so I'd like to fix it if I can.
Copy linkTweet thisAlerts:
@vwphillipsFeb 12.2005 โ€”ย just been playing with centering text

so

[code=php]

<script language="JavaScript" type="text/javascript">
<!--
font='Papyrus, 'Papyrus LET', 'Comic Sans MS', sans-serif;';
function CenterSelectText(){
// if (!document.all){ return; }
selObj=document.getElementsByTagName('SELECT');
for (i0=0;i0<selObj.length;i0++){
selObj[i0].style.fontFamily=font;
}
}
//-->
</script>
</head>

<body onload="CenterSelectText();" >

[/code]
Copy linkTweet thisAlerts:
@FangFeb 12.2005 โ€”ย JavaScript does work in Firefox, it's just the method employed that doesn't.

Go back to http://www.brainjar.com and pick-up the latest menu.

Always try a menu in as many (of your users) browsers as possible before adapting it to your requirements.

Also make sure your site is accessible without using JavaScript.
ร—

Success!

Help @kimberlily spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 โ€” BETA 5.18,
whats_new: community page,
up_next: more Davinciโ€ข003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinciโ€ข003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...