Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Background Image Rollover?

Status
Not open for further replies.

jchastai

Programmer
Oct 11, 2001
31
US
Is it possible with CSS to do a rollover on a table cell like you can with a link?

i.e.
TD { background-image: image1.gif; }
TD:Hover { background-image: image2.gif; }

If not - does anybody know how you can change the background image of a table cell with a mouseover event? (that works in both IE and Netscape?)

What I am trying to do is build a navigation bar (the difficult way). I have a table with the background of each cell set to the button image. This way I can put text in each cell to simulate the text on the button. I would like to change the button image when the user rolls over the cell or the text.

The simple way would just be to graphically create the buttons with the text ... but my application does not allow me to do that. I have a set of images (up, down buttons) that I need to turn into a navigation bar without graphically editing them.

Hopefully this makes some sense. Thanks for your help.
 
I did an FAQ on changing the color (faq216-1227) which could be modified to rollover the image -- hope that helps!
 
Glowball,

Thanks for your help. The problem appears that Netscape does not recognize image mouseover changes in a table.

Changing your FAQ to -
Code:
<table>
<tr>
    <td onMouseOver=&quot;this.background = 'button-hover.gif'&quot;
        onMouseOut=&quot;this.background = 'button-standard.gif'&quot;>
        This cell gets a red background
    </td>
</tr>
</table>

works fine with IE, but Netscape never performs the image swap.

Does anybody know how to do an image swap with Netscape (I hate this browser!).

Thanks for your help.
 
&quot;Netscape does not recognize ...&quot;
&quot;... works fine with IE, but Netscape ...&quot;
&quot;Does anybody know how to do an [something] with Netscape?&quot;
&quot;I hate this [Netscape] browser!&quot;

I sure wish I had a nickel for every time I read one of those quotes! Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top