Forum Moderators: open

Message Too Old, No Replies

Dhtml

Changing background images for a cell on_mouseover

         

rahmuss

10:18 pm on Aug 4, 2003 (gmt 0)

10+ Year Member



Ok... combining CSS and javascript I would like to make a class which will allow background A for the <td> tag. And another class which will allow background B. With those two options, I would like to get the background for a cell to change from A to B on_mouseover. I thought I had it figured out; but I can't even get CSS to make the classes work. Any help on this would be GREATLY appreciated. Thanks.

willybfriendly

10:37 pm on Aug 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have done this in pure CSS with the hover psuedo class - no javascript needed. Try something like:

.class
{background-image: url(image1);}
.class:hover
{background-image: url(image2);}

As I remember I had some cross browser problems with it. Never did implement the finished product as it was a concept design for a client that didn't fly.

WBF

AlwaysLearning

6:43 am on Aug 5, 2003 (gmt 0)

10+ Year Member



not sure if this will help, but i actually picked up the DHTML menu builder and have been pretty happy with the results. it generates some longer javascript code, but overall, no real complaints. just a thought.

rahmuss

7:09 pm on Aug 5, 2003 (gmt 0)

10+ Year Member



Thanks for the help. I can get the CSS to work with the <a> tag; but not with the <td> tag. The only problem with the link is that I would have to use "&nbsp;" to fill up the rest of the cell. I don't want that just because the code doesn't look as clean; but that's a great way to do it for now, so thanks. Any other suggestions are also welcome.