SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Oct 31, 2002, 22:32 #1
- Join Date
- Jan 2002
- Location
- Miami FLA
- Posts
- 30
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Changing TD backgroundcolor on mouseover
Hi all-
Hoping one of you gurus can help me out w/ this one...
I'm working on a global nav bar for an intranet portal.
Nav bar is a 100% table w/ 1 row and a bunch of columns. Each TD has its own bacground image, and I and want to accomplish the following:
on mouseover change the TD background from an image to a solid color; on mouse out, change the TD back to the background image.
I've managed to get it to function, although makes a nasty little yellow javascript error in the browser w/ the following "ERROR: INVALID ARGUMENT"
Here's the code for an individual TD:
Code:<a href="/intranet/admin/index.php"> <td width="10%" align="center" onmouseover="this.style.backgroundColor='#CCCCCC'" onmouseout="this.style.background='/intranet/admin/images/globalNav_bg.jpg'">Administration</td></a>
-
Nov 1, 2002, 07:40 #2
- Join Date
- Jun 2002
- Location
- .chicago.il.us
- Posts
- 957
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why not just use CSS for this?
Code:<style type="text/css"> TABLE.nav TD { background: #CCC; background-image: url(/intranet/admin/images/globalNav_bg.jpg); } TABLE.nav TD:hover { background-image: none; } </style> <table class="nav"> ... <td>...</td> ... </table>
----Adopt-a-Sig----
Your message here!
-
Nov 1, 2002, 08:50 #3
Bookmarks