Hi There,
I some a posting recently that addressed part of this but could not recall the actual syntax. This needs to work in both IE and NS and is a standard page with the nav on the left and then the main area with the content.
I would like a script which will onClick, drop down the choices and onClick again, hide the choices. Here is the direction I am taking.
HERE IS MY STARTING SCRIPT:
<script language="JavaScript">
<!--
var returnsOM=false
var contactsOM=false
var menuopen=false
var contactOpen='<table width="250"><tr><td class="sidenav"><img src="images/leftarrow.gif"
width="15" height="12" name="contactArrow">Contac
t Us</td></tr><tr><td class="choices">How to Contact Us</td></tr><tr><td class="choices"><tr><td class="choices">Hours of Operation</td></tr><tr><td
class="choices">Comments & Suggestions</td></tr><tr><
td class="choices">Join Newsletter</td></tr><tr><t
d class="choices">Live Help</td></tr></table>'
var contactClosed='<img src="images/leftarrow.gif"
width="15" height="12" name="contactArrow"> Contact Us'
function menu(src){
if (menuopen){
closeMenu(src)
} else {
openMenu(src)
}
}
function openMenu(src){
switch (src){
case 'contact':
if (document.all){
document.all.menuContact.i
nnerHTML = contactOpen
document.all.contactArrow.
src = "images/downarrow.gif"
menuopen = true }
if (document.layers){
d=document.icontact.docume
nt.lcontac
t.document
d.open()
d.write(contactOpen)
d.close()
}
break
}
}
function closeMenu(src){
switch (src){
case 'contact':
var myVar=src.name + 'Closed'
document.all.menuContact.i
nnerHTML= contactClosed
document.all.contactArrow.
src = "images/leftarrow.gif"
menuopen = false
break
}
}
//-->
</script>
HERE IS MY HTML:
..... other cells in nav section
<td class="sidenav">
<ilayer width="100%" name="icontact" onClick="menu('contact')">
<layer name="lcontact" style="position:absolute">
<div name="contact" id="menuContact" onClick="menu('contact')">
<img src="images/leftarrow.gif"
width="15" height="12" name="contactArrow">
Contact Us</div>
</layer></ilayer>
</td></tr>
..... more cells for nav here
Please let me know if you have a solution,
davlun