change bg onMoueOver

merlin's picture

They have: 410 posts

Joined: Oct 1999

hi there
i'd like to change the background of a table-cell OnMouseOver...
does anyone have an idea how to do that? (head & body-section)

thnx!

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Ali,

I've managed to do it with IE with dHTML, but NN doesn't like it. (haven't had time to play with it lately)

function swapColor(cell, switchOn)
{
source = (isOk) ? document.all[cell] : document.layers[cell];
if (switchOn == true) source.bgColor = '#66ff66';
else if (switchOn == false) source.bgColor = document.bgColor;
}

<td id="cellB0" onMouseOver="return swapColor('cellB0',true)"
onMouseOut="return swapColor('cellB0',false)">cell contents</td>

Hope this helps (and makes up for the confusion with css)

Vinny GrassBlade:cut&paste javascript

Where the world once stood
the blades of grass cut me still

merlin's picture

They have: 410 posts

Joined: Oct 1999

thnx vincent
i'll try it on monday...

They have: 67 posts

Joined: Aug 1999

Hi, It can be done in IE and you can see an example of it here if you're interested.
http://homes.arealcity.com/themanor/scripts/cellchanger.html

good luck.
Ian

Webmaster A1 JavaScripts
A1 JavaScripts
Web Development - Big Resources Inc
BIG Resources.com

merlin's picture

They have: 410 posts

Joined: Oct 1999

is there no possibility to do it in N? it's for internal use in our company and all of us have N, not IE...

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Ali,

fiddled with it today, still no go (for nn). I'm beginning to think I remember it's unsupported in ver 4 & down, but that may just be a wish for an alibi on my part. Part of the problem is that it refuses to recognize the source. I even tried source.document.bgColor with no luck. Either Netscape doesn't support changing the property, or I'm a bit thick-headed.

btw: isOk is defined as ie4+ browser

Vinny GrassBlade: cut&paste javascript

[This message has been edited by Vincent Puglia (edited 29 January 2000).]

Where the world once stood
the blades of grass cut me still

merlin's picture

They have: 410 posts

Joined: Oct 1999

ok i tried all the possibilities given, there was no way to do it in NN... i start to think it's really unsupported in NN...
but still, i'm open for your suggestions. thnx!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.