View Full Version : TR rollover to change class type!!

Feb 20th, 2003, 10:04 AM

how to change CSS class type when mouse rollover to TR(Not TD, i can do with TD but TR cannot!!)

i do this, but its not workable:

<tr onmouseover="className='bluetd';" onmouseout="className='bodytd';" onClick="document.form2.CustID.value=document.form2.CustID1 value;document.form2.submit()">
<td class="bodyTD"><%=counter%>.</td>
<td class="bodytd"><%=rsfname%></td>
<td class="bodyTD"><%=rscustID%></td>
<td class="bodyTD"><%=rscustcode%></td>
<td class="bodyTD"><%=salesman%></td>
<td class="bodyTD"><%=statedesc%></td>
<td class="bodyTD"><%=rsglcode%></td>

Feb 20th, 2003, 10:51 AM
Skip the classes in the TDs. They override the class you set in TR.

Shouldn't it be 'this.className'? Well, I'm no javascripter so I don't know about that. :p

Feb 20th, 2003, 12:59 PM
Originally posted by meow
Shouldn't it be 'this.className'?

yes, it should

Feb 20th, 2003, 03:19 PM
Originally posted by meow
Skip the classes in the TDs. They override the class you set in TR.

The TD ones override the TR? Wouldn't it "add on" and only override items if the same tag or effect was specified.

Feb 20th, 2003, 10:25 PM
I assumed they concerned the same 'effect' since you use bodytd in the actual rollover too?

If you have
.bluetd { background: blue }
.bodytd { background: yellow }

the yellow background in the cells will 'win' over a blue background set in a rue for TR. Same as it worked in plain vanilla HTML btw. :)