clysley81
05-09-2003, 04:02 AM
Hi
I have managed to find a really nice pull down menu which is easy to implement but the problem is I need more then one on my webpage. I changed all the variables and just about every name that could be changed which has generally worked, except their is a visiblity issue. If you click on the first two pulldown menus and try to click away the menu does not disapear whereas the thrid pulldown will work properly. This continues as you add more pull downs to the page. I put the examples here.
http://www11.brinkster.com/pcreviewd/Pulldown/new_page_1.htm
I'm fairly new to javascript but I think there may be a conflicting variable which I haven't changed. Please help. Here is the code that goes into the BODY. Are there other ways of adding more then one javascript to a page like this. Thanks
<script language="JavaScript1.2">
var ie5a=(document.getElementById&&navigator.appName.indexOf("Internet Explorer")!=-1)
if (ie5a){
document.write('<span style="position:relative;width:150px;height:20px;border:1px solid black;font:bold 10pt Verdana;padding:2px" onClick="showhidea(1);event.cancelBubble=1" ><span style="cursor:hand;width:100%">Script Categories <img src="tridown.gif"></span>')
document.write('<div id="innermenua" style="position:absolute;left:-1;top:20;width:180px;height:100px;border:1px solid black;background-color:white;overflow-y:scroll;visibility:hidden;">')
}
function gla(linknamea,desta){
document.write('<b><a href="'+desta+'">'+linknamea+'</a></b><br>')
}
function showhidea(statea){
var cacheobja=document.getElementById("innermenua").style
if (statea==0)
cacheobja.visibility="hidden"
else
cacheobja.visibility=cacheobja.visibility=="hidden"? "visible" : "hidden"
}
//Specify your links here- gla(Item texta, Item URLa)
if (ie5a){
gla("Selective Herbices","http://www.bbc.com")
gla("Dynamic Drive","http://www.dynamicdrive.com")
gla("Free Web Templates","http://www.freewebtemplates.com")
gla("Freewarejava.com","http://freewarejava.com")
gla("MSNBC","http://www.msnbc.com")
gla("Google","http://www.google.com")
gla("Yahoo","http://www.yahoo.com")
gla("CNN","http://cnn.com")
//Extend this list as needed
}
if (ie5a){
document.onclick=function(){showhidea(0)}
document.write('</div></span>')
}
</script>
I have managed to find a really nice pull down menu which is easy to implement but the problem is I need more then one on my webpage. I changed all the variables and just about every name that could be changed which has generally worked, except their is a visiblity issue. If you click on the first two pulldown menus and try to click away the menu does not disapear whereas the thrid pulldown will work properly. This continues as you add more pull downs to the page. I put the examples here.
http://www11.brinkster.com/pcreviewd/Pulldown/new_page_1.htm
I'm fairly new to javascript but I think there may be a conflicting variable which I haven't changed. Please help. Here is the code that goes into the BODY. Are there other ways of adding more then one javascript to a page like this. Thanks
<script language="JavaScript1.2">
var ie5a=(document.getElementById&&navigator.appName.indexOf("Internet Explorer")!=-1)
if (ie5a){
document.write('<span style="position:relative;width:150px;height:20px;border:1px solid black;font:bold 10pt Verdana;padding:2px" onClick="showhidea(1);event.cancelBubble=1" ><span style="cursor:hand;width:100%">Script Categories <img src="tridown.gif"></span>')
document.write('<div id="innermenua" style="position:absolute;left:-1;top:20;width:180px;height:100px;border:1px solid black;background-color:white;overflow-y:scroll;visibility:hidden;">')
}
function gla(linknamea,desta){
document.write('<b><a href="'+desta+'">'+linknamea+'</a></b><br>')
}
function showhidea(statea){
var cacheobja=document.getElementById("innermenua").style
if (statea==0)
cacheobja.visibility="hidden"
else
cacheobja.visibility=cacheobja.visibility=="hidden"? "visible" : "hidden"
}
//Specify your links here- gla(Item texta, Item URLa)
if (ie5a){
gla("Selective Herbices","http://www.bbc.com")
gla("Dynamic Drive","http://www.dynamicdrive.com")
gla("Free Web Templates","http://www.freewebtemplates.com")
gla("Freewarejava.com","http://freewarejava.com")
gla("MSNBC","http://www.msnbc.com")
gla("Google","http://www.google.com")
gla("Yahoo","http://www.yahoo.com")
gla("CNN","http://cnn.com")
//Extend this list as needed
}
if (ie5a){
document.onclick=function(){showhidea(0)}
document.write('</div></span>')
}
</script>