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.

JavaScript Forum


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



Reply
Can you have different fonts in a drop down menu?
Old 03-21-2007, 05:45 PM Can you have different fonts in a drop down menu?
Skilled Talker

Posts: 54
Trades: 0
Hi
I have a simple drop down menu for people to select fonts.

Code:
<select name="font" onChange="update_font(this.options[selectedIndex].value);">
            <option value="alladin" selected>Alladin</option>
            <option value="backslash">Backslash</option>
            <option value="cafe">Cafe</option>
            <option value="camo">Camo</option>
            <option value="Darkh4">Dark Horse</option>
            <option value="dodger">Dodger</option>
            <option value="farcry">Farcry</option>
            <option value="fatboyslim">Fatboy Slim</option>
            <option value="hippy">Hippy</option>
            <option value="jaws">Jaws</option>
            <option value="metalgearsolid">Metal Gear</option>
            <option value="metalgearsolid2">Metal Gear 2</option>
            <option value="satanic">Satanic</option>
            <option value="shadow">Shadow</option>
            <option value="sponge">Sponge</option>
            <option value="starsky">Starsky</option>
            <option value="strokes">Strokes</option>
            <option value="tech9">Tech 9</option>
            <option value="terrorvision">Terrorvision</option>
            <option value="underground">Underground</option>
            <option value="unreal">Unreal</option>
          </select>
Is it possible for each different option to be in that style font. If it isn't is there a way of having a image or line of text that changes when the cursor rolls over or clicks an option. Thanks.
digi duck is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-21-2007, 07:16 PM Re: Can you have different fonts in a drop down menu?
WebSavvy's Avatar
Extreme Talker

Posts: 166
Name: Deb
Trades: 0
Yep, you can set that up in your CSS file.

Example:
Code:
option.alladin {
   font-family:alladin;
}
You can class "option" in your CSS file just like you can with any block level element, and so-forth.

Then in the HTML code for the option you'd need to put it this way:
Code:
<option class="alladin">Alladin</option>
Understand though, that simply because you've set the class as that font, that your end-user will only see that class in that font IF they have that font installed on their PC.
__________________

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

Last edited by WebSavvy; 03-21-2007 at 07:17 PM..
WebSavvy is offline
Reply With Quote
View Public Profile Visit WebSavvy's homepage!
 
Old 03-22-2007, 03:04 PM Re: Can you have different fonts in a drop down menu?
Skilled Talker

Posts: 54
Trades: 0
so unless they have the font installed on their comp it wont show up?

How come the font shows up then when they create a sig? Do i need to link to the fonts? They're located at http://gamesigs.co.uk/images/sig_cre.../font_name.ttf
digi duck is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 09:31 AM Re: Can you have different fonts in a drop down menu?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
How come the font shows up then when they create a sig
Because it's an image.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-23-2007, 02:30 PM Re: Can you have different fonts in a drop down menu?
Skilled Talker

Posts: 54
Trades: 0
so is there a way of placing a blank image with the text on in the drop down menu?
digi duck is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 02:39 PM Re: Can you have different fonts in a drop down menu?
WebSavvy's Avatar
Extreme Talker

Posts: 166
Name: Deb
Trades: 0
Do you have those fonts installed on your computer? If so, then, yes.

Make an image file using the font for each of the ones you have specified.
Then, in your CSS file define the class this way:
Code:
option.verdana {
   background:url("verdana.png");
}
Now, that should work. I'm not sure if it'd display properly when called
<option class="verdana"></option>
or not?

You can try it and see (I've never needed to do this before so ...)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
WebSavvy is offline
Reply With Quote
View Public Profile Visit WebSavvy's homepage!
 
Reply     « Reply to Can you have different fonts in a drop down menu?
 

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.99174 seconds with 12 queries