Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 CSS Help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 27 October 2001 :  22:31:40  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I need to know how to make a certain class have a hover equiv...

this is the class that I need to make a hover equiv - I want it so when the table cell is hovered over, the background color changes and the text color changes, and the text-decoration goes to underline. I've tried 'tdhading.hover', 'tdheading:hover' and they dont work, I'm not sure how to do this.

.tdheading
{
background-color:#0066FF;
color:#000000;
font-style: bold;
font-family: Arial, Verdana;
text-decoration: none;
text-transform: none;
text-align: center;
}

---------------
Da_Stimulator has spoken

Cyber Paladin
New Member

55 Posts

Posted - 27 October 2001 :  22:53:47  Show Profile  Visit Cyber Paladin's Homepage
You'll have to use the OnMouseOver, and OnMouseOut functions to get that to work. Tables don't have a hover ability like that.

<tr onMouseover="this.style.backgroundColor='#000000'" onMouseout="this.style.backgroundColor='#2D2D2D'"> Something like that.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 27 October 2001 :  23:00:14  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
what if I used <span> inside of the td with the class tdheading, would that be able to hover?

---------------
Da_Stimulator has spoken
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 27 October 2001 :  23:06:25  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
btw how would I put that into a function? currently I have this...

function changebg(tdbgcolor)
{
this.style.backgroundColor = tdbgcolor;
}

but it says 'this' is not an object...

---------------
Da_Stimulator has spoken
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 28 October 2001 :  00:44:21  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
stim, look at hotmails new site. When you click on a check box to delete the item or different things the whole row turns a different color. Maybe that might help with some ideas.

Brad
Go to Top of Page

Rasco
Advanced Member

Germany
3192 Posts

Posted - 28 October 2001 :  03:01:14  Show Profile  Send Rasco an ICQ Message
Try to use the :hover pseudo class from CSS.
Works like that

a:hover{color:red; text-decoration:none}


Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 October 2001 :  03:05:52  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I already tried that

---------------
Da_Stimulator has spoken
Go to Top of Page

Rasco
Advanced Member

Germany
3192 Posts

Posted - 28 October 2001 :  05:47:17  Show Profile  Send Rasco an ICQ Message
Uuuppsss....sorry, shouldn`t think about JavaScript and CSS shortly after getting up.

<td onmouseover="bgColor='#0000ff' "onmouseout="bgColor='#ff0000'">

This works only for IE. Havent`t figured a way out to get it run on NS ond Opera ant to put it in a function, yet.
Will work on that.

Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 28 October 2001 :  07:11:36  Show Profile
Here's what you do to make a table change it's bgcolor when you have your mouse on it:
<td bgcolor="#DFDFDF" onmouseover="mOvr(this,news);this.style.backgroundColor='#ECECEC'" onmouseout="mOut(this,news);this.style.backgroundColor='#DFDFDF'" onClick="goToURL('parent','news.htm');return document.returnValue;">

I use this on my site all the time (http://www.frutzle.com) and it works in Netscape 6 and IE. Netscape 4.72 and Opera5 just show the default bgcolor.

Go to Top of Page

Rasco
Advanced Member

Germany
3192 Posts

Posted - 28 October 2001 :  07:26:08  Show Profile  Send Rasco an ICQ Message
Sorry, thatīs not right.
It`s only working with links.
Moving in IE 6.0 in section "Hello & Welcome...." it`s also working.
Trying it with NS 4.72 and Opera 5.01, nothing happens.

Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 28 October 2001 :  07:34:35  Show Profile
quote:

Sorry, thatīs not right.
It`s only working with links.
Moving in IE 6.0 in section "Hello & Welcome...." it`s also working.
Trying it with NS 4.72 and Opera 5.01, nothing happens.



What do you mean it only works with links? I have this all over my site and the tables are not linked (only in the sub menu).
As I said, in Netscape 6 and IE it works. It doesn't work in Netscape 4.73 and Opera, but it shows the default bgcolor.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 October 2001 :  08:57:24  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Thats alright, I got it...


function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#CCFFFF";
elem.style.cursor = 'hand'}

function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";}



<td width="100%" onMouseover="LmOver(this, '#000099')" onMouseout="LmOut(this, '#000066')">


---------------
Da_Stimulator has spoken
Go to Top of Page

Rasco
Advanced Member

Germany
3192 Posts

Posted - 28 October 2001 :  09:19:33  Show Profile  Send Rasco an ICQ Message
quote:

What do you mean it only works with links? I have this all over my site and the tables are not linked (only in the sub menu).
As I said, in Netscape 6 and IE it works. It doesn't work in Netscape 4.73 and Opera, but it shows the default bgcolor.



Sorry, man. I apologize for that. I have read out that. Looks like, two hours of sleep at night are not nearly enough. Will go to bed and get some more.


Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 29 October 2001 :  14:11:03  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
If you wanted to do it using CSS all you had to was:

<td onmouseover="className='whatever'" onmouseout="className='otherclass'">

I you want it clickable then you do:

<td onclick="javascript:location.href='webaddress' onmouseover="className='whatever'" onmouseout="className='otherclass'">

Also, if you are doing it for the forum or somewhere where there are multiple <TD>s in the <TR>, then give the above events to the <TR> instead of the <TD> and remove all colorbg from the <td>s

Aside from that, you got the class itself setup correctly..

You can see it working here: http://realmslore.dingojunction.com/forum...forgive the crappy design I haven't made up my mind what I am going to do.

********************
We all have photographic memories, some just don't have film.

Edited by - snaayk on 29 October 2001 14:12:12
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 29 October 2001 :  14:33:17  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
also in use on this page as well:
http://www.nineinchnailz.com/forum/default.asp

Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 29 October 2001 :  14:46:30  Show Profile
Hey thanks, that'll save me a lot of trouble next time I redo my site and still want to use that stuff.


http://www.frutzle.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07