You are here: Changing CSS style in use for <TD> using Javascript - How? « HTML « IT news, forums, messages
Changing CSS style in use for <TD> using Javascript - How?

Posted by Dave Smithz on 02/24/06 14:19

Hi there,

I want to change the CSS style sheet applied to a table cell when the mouse
moves over it. But I am not sure how to do it.

I have written a function like this:

function highlight_cell (obj) {
obj.styleSheet="navHighlightCell";
};

Which has associated style sheet like this:

..navHighlightCell {
background-color: #FFFFFF;
}

But it does not work. I know I can just use the following code in the
function
obj.style.backgroundColor='#FFFFFF';
I have got this to work, but I do not want to hard code colours or anything
like that. I want to keep them in stylesheets.

Obviously the solution should be one that is cross browser compatible.

Can anyone help?

Kind regards

Dave

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация