Forum Moderators: open

Message Too Old, No Replies

<td> onMouseOver menus

possible?

         

ukgimp

4:35 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello

I dont have the luxury of pure CSS using the block atribute. I have been trying to get a menu system for a set of rows that looks like a button then during a hover over the whole cell it changes the background colour. Having troubles, I think I am getting inheritances mixed up or similar.

First time round the colour does not appear but after first hover it works fine. I am using onmouseover and onmouseout

Am I missing a command. Here is a snippet of the code. Dont tell anyone :)

.cell_over { BACKGROUND-COLOR: #8494ce }
.cell_out { BACKGROUND-COLOR: #4a4284 }

<td onMouseOver="this.className='cell_over';" onMouseOut="this.className='cell_out';">Menu</td>

Cheers

Alternative Future

4:40 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

<td style="BACKGROUND-COLOR: #4a4284" onMouseOver="this.className='cell_over';" onMouseOut="this.className='cell_out';">Menu</td>

I think you have to set the color initially I have used an inline style for the example but you could set the initial color in the style class associated with the td element!

HTH,

-gs

ukgimp

4:30 pm on Mar 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes that worked. Thanks.

Does not seem to like Opera though. Used a display block to get it to the right width but no change wrt onmousover.

Any ideas

Alternative Future

4:40 pm on Mar 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had the same problem with opera what I had to do in the end was put it all in the <td> inline style. Which I am sure worked can't remember though :(

I know this is not the best way to go but I downloaded Opera7 and never looked back ;-)

-gs