Casey Miller wrote on 07 feb 2006 in comp.lang.javas cript:
I have a site, http://www.onemorewebsite.com, that has a menu on the
left side and a picture on the right side with a middle div for
content in the middle. When I mouse over the menu, the picture
changes. I've got that part to work. But I also want the text caption
under the picture to change also. I can't figure this one out. I've
spent days learning about innerHTML, textnodes, etc..but nothing
works. Can anyone give me a clue? I'd sure appreciate it. I got
append.textnode to work. I can append the caption all day long, but
I'm trying to replace it.
There are many ways, this is one:
<div id='nonHovering ' style='display: ;float:right;'>
<img src='img1.jpg'>
<br>
Text 1
</div>
<div id='Hovering' style='display: none;float:righ t;'>
<img src='img2.jpg'>
<br>
Text 2
</div>
.... menu ...
onmouseover="
var nonHovering = document.getEle mentById('nonHo vering');
var Hovering = document.getEle mentById('Hover ing');
nonHovering.sty le.display = 'none';
Hovering.style. display = '';"
onmouseout="
var nonHovering = document.getEle mentById('nonHo vering');
var Hovering = document.getEle mentById('Hover ing');
nonHovering.sty le.display = '';
Hovering.style. display = 'none';"
[a script function would make this more consize]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)