Poornima a écrit :
Hello
I have a html page with 2 layers,one for the main menu and the other
for the submenu.The submenu should be displayed on hovering on the main
menu is displayed else it should be hidden.
How can i get the above requirement using javascripts
why not with css ?
a span { display: none }
a:hover span { display: block }
<a href=" ...>menu 1
<span>
<a href=" ...>submenu 1.1</a>
<a href=" ...>submenu 1.2</a>
</span>
</a>
can u plz give me the javascript code
HTML :
=======
<p><a onclick="show('d_1')" href=" ...>menu 1</a></p>
<div id="d_1" onclick="show(this.id)">
<p><a href=" ...>submenu 1.1</a>
<p><a href=" ...>submenu 1.2</a>
</div>
JavaScript :
============
function show(divId) (
divId = document.getElementById(divId).style;
divId.display = divId.display==''? 'none' : '';
}
onload = function() { show('d_1'); }
(not tested)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date