Closed Thread Icon

Topic awaiting preservation: Changing a background color of a table cell with link Pages that link to <a href="https://ozoneasylum.com/backlink?for=22276" title="Pages that link to Topic awaiting preservation: Changing a background color of a table cell with link" rel="nofollow" >Topic awaiting preservation: Changing a background color of a table cell with link\

 
Author Thread
bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-22-2004 03:50

hey all,

So this one has me stumped you can view it here

I'm using a mouseover for a table row to change the background color. But I'm having trouble keeping the link colors consistent, just with the underline. Any ideas on how to fix this?

Oh link to css here

Thanks!

(links fixed)


.:[ Never resist a perfect moment ]:.

(Edited by bitdamaged on 06-22-2004 04:18)

ninmonkey
Nervous Wreck (II) Inmate

From:
Insane since: Nov 2003

posted posted 06-22-2004 04:14

It looks like you pasted your lan ip.

Antares
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jun 2004

posted posted 06-22-2004 23:02

Just change the color on link hover to black and it will be constant:

a.verdana11:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
background-color: #215785;
text-decoration: none;
}

(sorry for my english )

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-22-2004 23:20

Moved this to a more relevant forum. That didn't work I think I need to traverse the dom a bit but I'm not clear how. This doesn't have to work in all browsers but in the DOM compatible ones it would be nice.



.:[ Never resist a perfect moment ]:.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 06-22-2004 23:50

This would do it you want to go a CSS-only route:

code:
tr:hover a.verdana11 {
color: #fff;
text-decoration: none;
}


Although as always not in good old IE, and I suppose that would be a requirement... if that's the case let me know and I'll look into the DOM traversing, shouldn't be all that difficult actually.

kuckus

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-22-2004 23:53

Actually IE is the only one I have to hit right now I almost feel stupid asking this question but I haven't done straight web work in a long time, but I'm doing some contracting work so I'm back at it. Makes me realize I haven't kept up on some things.



.:[ Never resist a perfect moment ]:.

(Edited by bitdamaged on 06-22-2004 23:54)

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 06-23-2004 00:08

I only had 5 minutes now and couldn't get it to work yet, but starting with the code posted by poi and myself here:

http://www.ozoneasylum.com/21648

you might have better luck.... Otherwise I'll have more time in about 8 hours - need some sleep first


My attempt which is still happily producing error messages:

code:
function rowOver( row ) {
currentNode = row.parentNode.firstChild
while( currentNode )
{
if( currentNode.nodeName == "TD" ) {
currentNode2 = currentNode.firstChild
while( currentNode2 )
{
if( currentNode2.nodeName == "A" ) {
currentNode2.style.color = "#ffffff";
}
currentNode2 = currentNode2.nextSibling
}
}
currentNode = currentNode.nextSibling
}
}


Heh... has to be the most elegant bit of code I have come up with in quite a while

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-23-2004 00:43

Sweet!

Just had to change
currentNode = row.parentNode.firstChild

to

currentNode = row.firstChild

thanks kuckus!



.:[ Never resist a perfect moment ]:.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 06-23-2004 19:02

Ah I must have thought we were starting from the TD and not the TR there...

Cool to see you got it to work =)

« BackwardsOnwards »

Show Forum Drop Down Menu