|
Post by Wormopolis on Jun 9, 2010 23:34:45 GMT -8
well.. I did some research and it looks like styling a single option tag inside a selct isnt quite cross-browser.
I was able to make it bold a single option in firefox, but not IE. I can make it color the text in both. but we cant do it the way I originally hoped with just HTML in that variable at the top. apparently it strips tags when it inserts text into a option tag.
so we will have to use CSS. the bold still wont work in all browsers, BUT we can make it a different color in all browsers if that is a plausible alternative.
put that variable back to normal at the top.
in this line:
var cur_sel = "<select onchange='if(this.options[this.selectedIndex].value) window.location = \"index.cgi?board=\" + this.options[this.selectedIndex].value + \"\"'><option>" + subboardTitle + "</option>";
change it to:
var cur_sel = "<select onchange='if(this.options[this.selectedIndex].value) window.location = \"index.cgi?board=\" + this.options[this.selectedIndex].value + \"\"'><option style='font-weight:bold; color: #00FF00'>" + subboardTitle + "</option>";
that will color it green in all browsers, and make it bold in the ones that support it.
|
|
|
Post by tunescool on Jun 10, 2010 0:10:28 GMT -8
it didnt bold or change color in safari or firefox
|
|
|
Post by Wormopolis on Jun 10, 2010 0:51:21 GMT -8
looks like it only colors it in the drop down and not the default then. as I said.. there isnt a cross browser way I could find.
if you add CSS into the select tag it will affect all the options.
|
|
|
Post by tunescool on Jun 10, 2010 4:50:51 GMT -8
didnt you just put it in the select tag
|
|
|
Post by Wormopolis on Jun 10, 2010 7:03:28 GMT -8
no. it was added directly to the first option tag.
|
|
|
Post by tunescool on Jun 10, 2010 7:41:19 GMT -8
i dont see a class and thats the only way i know how to use css
|
|
|
Post by Wormopolis on Jun 10, 2010 14:23:23 GMT -8
ah. yeah there are 2 ways to add styling to an element. by giving it a class name and defining the class in a style tag somewhere else, or putting it directly into the element itself like I did.
I will play around a bit more to see if I can get that default element to colorize in FF, but I was almost certain it would work. It shows it being bold and blue when you do the drop down though...
|
|
|
Post by tunescool on Jul 10, 2010 3:44:19 GMT -8
im just going thru all my threads to see if they need to be closed or whatever. if you cant get this close this thread ill ask on pbs someday if anyone can get it
|
|
|
Post by Wormopolis on Jul 10, 2010 21:14:50 GMT -8
If they can find a cross browser way to do this, more power to em.
|
|