PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
dull1554
Forum Regular
Posts: 680 Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W
Post
by dull1554 » Tue Dec 16, 2003 8:27 pm
i'm trying to code a php menu system, i wanted to use css to make the table cells change color on hover, heres what i have
Code: Select all
#MAINMENU {
BACKGROUND-COLOR : #808080;
}
#SECONDARYMENU {
BACKGROUND-COLOR : #C0C0C0;
}
and this is what i tried but it failed horriably!!!!!!!!!
Code: Select all
#MAINMENU {
BACKGROUND-COLOR : #808080;
}
#MAINMENU:hover {
BACKGROUND-COLOR : #C0C0C0;
}
#SECONDARYMENU {
BACKGROUND-COLOR : #C0C0C0;
}
#SECONDARYMENU:HOVER {
BACKGROUND-COLOR : #808080;
}
is it just that you can't change table bgcolor on:hover?
is there a different way of doing this?????
dull1554
Forum Regular
Posts: 680 Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W
Post
by dull1554 » Tue Dec 16, 2003 8:34 pm
thanks
dull1554
Forum Regular
Posts: 680 Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W
Post
by dull1554 » Tue Dec 16, 2003 8:37 pm
is there any way in which i could create some sort of a element inside my <td> that i could pass the hover thingy(for lack of better words to describe it) to so i still get a similar effect?
Paddy
Forum Contributor
Posts: 244 Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:
Post
by Paddy » Tue Dec 16, 2003 8:41 pm
Are rollovers out of the question in your situation?
microthick
Forum Regular
Posts: 543 Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC
Post
by microthick » Tue Dec 16, 2003 8:42 pm
Using JavaScript, you can change the bg color of table cells.
But if you're only using css, you can only change the bg color of links, using a:hover.
DuFF
Forum Contributor
Posts: 495 Joined: Tue Jun 24, 2003 7:49 pm
Location: USA
Post
by DuFF » Tue Dec 16, 2003 8:44 pm
Yes, I've done it before with Javascript. It's pretty easy, just customize this example:
Heres an example:
Code: Select all
<td bgcolor="#808080" onMouseOver="style.backgroundColor='#C0C0C0'; style.cursor='hand'" onMouseOut="style.backgroundColor='#808080';" width="150">
dull1554
Forum Regular
Posts: 680 Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W
Post
by dull1554 » Tue Dec 16, 2003 8:46 pm
paddy you mean a rollover image? i could do that but i want to keep it as fast as possiable, and images slow page load......., how might one do it with js, js i dont have a clue about
Paddy
Forum Contributor
Posts: 244 Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:
Post
by Paddy » Tue Dec 16, 2003 8:54 pm
DuFF wrote: Yes, I've done it before with Javascript. It's pretty easy, just customize this example:
Heres an example:
Code: Select all
<td bgcolor="#808080" onMouseOver="style.backgroundColor='#C0C0C0'; style.cursor='hand'" onMouseOut="style.backgroundColor='#808080';" width="150">
That one just went in my code snippet file.
Cheers Duff.
dull1554
Forum Regular
Posts: 680 Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W
Post
by dull1554 » Tue Dec 16, 2003 8:57 pm
sorry duff poster just before i so i did not see his post, thanks, i got it, i went out on my own and i'm using this
Code: Select all
<td onMouseover="this.bgColor='#CFCFCF'"onMouseout="this.bgColor='transparent'">