Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Dom rollover
- From: javascript at webdesignofficina.com (Guillaume)
- Subject: [Javascript] Dom rollover
- Date: Thu Sep 28 11:58:36 2006
Hi JS community,
I'm trying to change the color of several pieces of text in tags ( h1, p
and a ) contained in a div called #too when I mousover this div...
A rollover basically...
I thought switching node's classes contained inside #too...
It doesn't work... I can change the background-color, add a colored
border... But the h1, p and a tags won't change their colors...
Anything obvious I'm missing below ?
Here's the concerned tree inside my page:
<div id="too">
<h1 class="tiToolsH">
+Tools
</h1>
<p class="toolsL">
<span class="AD">
<a href="#upUgo" id="shTools">Toolbar</a>
</span>
</p>
</div>
Here's the Js:
var oncL9 = document.getElementById('too');
oncL9.onmouseover = tooOv;
function tooOv() {
var el = document.getElementById('too');
if (el.hasChildNodes()) {
var nodels = el.childNodes;
for (var i = 0; i < nodels.length; i++) {
nodels[i].className = 'tooOve';
};
};
}
And here's the Css:
.tooOve{
color: red;< This one doesn't work
background-color: black; < This one works
cursor: pointer;
}
So why can I not switch class of the child nodes inside #too to simply
change the text color from grey to red ?
Guillaume
- Follow-Ups:
- [Javascript] Dom rollover
- From: diego nunes
- [Javascript] Dom rollover
- From: Triche Osborne
- [Javascript] Dom rollover
- From: Paul Novitski
- [Javascript] Dom rollover
- Prev by Date: [Javascript] Hiding email addresses
- Next by Date: [Javascript] Dom rollover
- Previous by thread: [Javascript] Hiding email addresses
- Next by thread: [Javascript] Dom rollover
- Index(es):