Re: Traversing through DOM, identifying td's and manipulating
Scott Sauyet <[email protected]> Thu, 02 Mar 2006 10:29:43 -0500
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Maninder, Singh wrote:
> Just want to take some expert opinion on the following problem.
>
> I have around 5-10 rows like mentioned below.
>
> Each of them have the same bg color except the one that would be active.
My first suggestion would be that you move your presentational aspects
to CSS.
This is cleaner, smaller, and easier to work with:
<table class="foo">
<tr class="active">
<td><a href='#)'><img src="foo1_active.gif"></a></td>
<td><a href='#'>Foo1</a></td>
</tr>
<tr>
<td><a href='#)'><img src="foo2.gif"></a></td>
<td><a href='#'>Foo2</a></td>
</tr>
<tr>
<td><a href='#)'><img src="foo3.gif"></a></td>
<td><a href='#'>Foo3</a></td>
</tr>
</table>
than is this:
<table>
<tr>
<td bgcolor="#ffffff"><a href='#)'><img src="foo1_active.gif"
border="0" height="25" width="36"></a></td>
<td bgcolor="#ffffff"> <a href='#'><b>Foo1</b></a></td>
</tr>
<tr>
<td bgcolor="#305daa""><a href='#)'><img src="foo2.gif"
border="0" height="25" width="36"></a></td>
<td bgcolor="#ffffff"> <a href='#'><b>Foo2</b></a></td>
</tr>
<tr>
<td bgcolor="#305daa""><a href='#)'><img src="foo3.gif"
border="0" height="25" width="36"></a></td>
<td bgcolor="#ffffff"> <a href='#'><b>Foo3</b></a></td>
</tr>
</table>
> So, what I want to do is that when a particular header is clicked, I
> want to change the bgcolor's of the 2 td's and flip the src of the img
> in the first td.
Check out Ben Nolan's Behaviour library, at
http://bennolan.com/behaviour/
This is a small little library that should help you do what you fairly
easily.
Good luck,
-- Scott
Unsubscribe
[email protected]
List info
http://www.quirksmode.org/dom/list.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wdf-dom/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/