From: Jeff <je...@we...> - 2001-01-26 18:52:31
|
Ok, here's some weirdness for you: Earlier, I posted a way to get the setHTML to work when writing inline styles into nested layers in Netscape by removing the layer from the parent, writing the style into it, then adding the layer back to the parent. Everything worked fine. It just so happens that I had been passing values to a function that wrote the style into the layer, something like: (pseudo-code) function writeIt(text,fontSize, fontFamily,color) { eval(layeName+".setHTML='<SPAN STYLE=\"font-size: " + fontSize + "px; fontFamily: " + fontFamily + "; color:" + color +";\">" + text + "</span>"); } Don't ask me why, I just happened to be doing it that way for the test. So, as I said it worked fine. Then I decide to just pass the function a string representing the entire style to be applied, something like this: writeIt("text goes here","font-size: 13px;fontFamily: courier;color: white;"); function writeIt(text,style) { eval(layeName+".setHTML='<SPAN STYLE=\" ' + style + ' \">" + text + "</span>"); } Now, here's the weird part: This second version works fine too... except for one thing: the font-size doesn't get applied in Netscape (4.7 and 4.76 under Win98). The color and the fontFamily do get applied however.... and the whole thing works in IE 5.0 and 5.5 (Win98). But that's just too strange... it can't be a CSS syntax thing, since the cobbled together style string in the first example works fine. So what's the deal? -- Jeff Greenberg |