[thelist] write a style rule for a dynamically generated tag?

Ken Kogler ken.kogler at cph.org
Thu Jul 11 15:25:09 CDT 2002


What about using a more specific selector? If these 21 spans are all inside
a div or another span (or td, or something), you can assign that parent
element an #id, then go from there.

Assume the 21 spans are wrapped in a div. Call the div something unique,
like so:

<div id="tom-is-cool">span span span span span span span (wonderful
span!)</div>

Then in the CSS:

#tom-is-cool span:hover {background-color: #036; }

Or something like that... you can at least simply this a bit in this manner.
Might not clean it up 100%, but it's a start.

HTH,

--ken (who's still smiling form the monty python reference earlier...)

"Well, there's egg, bacon, sausage and span -- that's not got much span in
it"
"i don't want any span!"
"i'll have your span, dear... i love it"
:-)

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Tom Dell'Aringa
Sent: Thursday, July 11, 2002 3:17 PM
To: thelist at lists.evolt.org
Subject: [thelist] write a style rule for a dynamically generated tag?


Heyall,

I'm using document.write to write this horrible line of code:

<span id='m_" + i + "' onclick='controlVA(this.id, 20, \"manual\")'
style='font-size:7px; background-color: "+EQ_BGCOLOR+"; width: 11;
height: 10; cursor: hand; border-right: 1px solid #003366'
onmouseover='showBarValue("+i+", \"manual\")'></span>

It writes this out 21 times (for a control) so I have 21 ids that
range from "m_0" to "m_21".

I would prefer to the presentation info placed up in the style sheet
instead of inline, writing it 20 freaking times. But I can't figure
if there is a way to do it sine the _# is changing..any ideas?

Tom

=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list