appearance of drop down list boxes

Not much luck with my last question about grouping elements. Thanks for replying Weirdofreak though Oh well, I'll have to do it a longer way than I wanted to. Here's another poser ...

I want to be able to change the font in each option section of a drop down dialog box. I can change the colour, font and size of the entire thing. I can change the colour of each option if i wanted to.

I can't see how to change the font. I don't even know if it is possible. Nothing I've read says it isn't, but neither have I seen any examples either - not anything that is even close and nothing I've tried seems to do the trick either.

You can see what I'm trying to do at http://brisray.com/test/dropbox1.htm

As usual, any and all replies and suggestions are welcome.

Ray

Comments

  • There's nothing wrong with your method, just your browser. It works fine in Firebird, and not at all in IE.
  • Thanks again Weirdofreak. I usually test the code in IE, Mozilla, Netscape and Opera before posting. This time I didn't and missed what was going to happen.

    Opera - doesn't display the seperate colour fields or fonts
    Netscape & Mozilla - displays both
    IE - displays the colour fields but not the fonts.

    Just goes to show again the differences in browsers and the need to test everything in all of them.

    Ray


  • Try using multiple layers. That'll be VERY VERY toublesome. But if you're determined, it'll look really cool.

  • I've already looked into that, and you're right. I think it's going to be a lot more trouble than it's worth.

    Another way I thought of was to create a clickable table with a font in each of the cells. Whilst messing around with this I also found that it is possible to let someone type in their own font name and the site can use that.

    Even the test page I wrote isn't finished yet (where does the time go?) but you can see the principle at the bottom of http://brisray.com/test/userfnt2.htm

    The font you type in must be exactly as the font reports itself to the operating system - for example you can't use "comic" as the real font name is "Comic Sans MS" but if it's accepted you'll find the page heading changes to that font, whether it's in the table or not.

    Ray




  • As Ray suggested, the font face must be specified by its proper name eg. Century Gothic or Comic Sans MS. The font must be installed on the user's machine to correctly display it.

    Here's a dropdown example:


    Arial
    Arial Black
    Book Antiqua
    Century Gothic
    Comic Sans MS
    Courier
    Courier New
    Fixedsys
    Garamond
    Geneva
    Georgia
    Impact
    Lucida Console
    Lucida Handwriting
    Lucida Sans
    Matisse ITC
    MS Sans Serif
    MS Serif
    News Gothic MT
    Palatino
    Small Fonts
    System
    Tahoma
    Terminal
    Times New Roman




    function changeFont()
    sel_face = document.form1.face.selectedIndex;
    face = document.form1.face.options[sel_face].value;

    str += "";

    document.getElementById("div1").innerHTML = str;


    The script will place the font face definition here


    : I've already looked into that, and you're right. I think it's going to be a lot more trouble than it's worth.
    :
    : Another way I thought of was to create a clickable table with a font in each of the cells. Whilst messing around with this I also found that it is possible to let someone type in their own font name and the site can use that.
    :
    : Even the test page I wrote isn't finished yet (where does the time go?) but you can see the principle at the bottom of http://brisray.com/test/userfnt2.htm
    :
    : The font you type in must be exactly as the font reports itself to the operating system - for example you can't use "comic" as the real font name is "Comic Sans MS" but if it's accepted you'll find the page heading changes to that font, whether it's in the table or not.
    :
    : Ray
    :
    :
    :
    :
    :

    [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories