a JS question (lazy code format)
Date: 03/01/05
(WebDesign) Keywords: php, java
Lazy formatting cause I cant recall how to show code, so here is the quick and dirty. Inherited site with clickable menu, client is nitpicking over the fact that the menu does not disapear when you click on another object.
(source http://gateway.rossoptical.com/nav.htm )
is there a simple way to pull this off? Drop down menu's with mouse over focus is not what the client wants (sadly).
script type="text/javascript"
function toggle(obj) {
var menu = document.getElementById(obj);
if (menu.style.display == 'none'){
menu.style.display = 'block';
} else {
menu.style.display = 'none';
}
}
/script
a href="#" onclick="toggle('menu2')">DOUBLETS and TRIPLETS/a
ul style="display: none;"
li a href="./php/product-doublets_standard_achromats.php" target="mainFrame" Standard Achromats /a /li>
li a href="./php/product-doublets_precision_aplanats.php" target="mainFrame" Precision Aplants /a /li>
li a href="./php/product-doublets_negative_achromats.php" target="mainFrame" Negative Achromats /a /li>
li a href="./php/product-doublets_laser_achromats.php" target="mainFrame" Laser Achromats /a /li>
li a href="./php/product-steinheil_triplets.php" target="mainFrame" Steinheil Triplets /a /li>
/ul
Source: http://www.livejournal.com/community/webdesign/818419.html