PDA

View Full Version : Help with AnyLink Drop Down Menu



yankeeschick
05-04-2007, 10:08 AM
1) Script Title: AnyLink Drop Down Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: Dropdown links not showing up

Can you help? My dropdowns aren't appearing; the links are. I am in "testing" mode so it is not currently live (www.yankeeschick.com).


HEAD section:

<style type="text/css">

#dropmenudiv{
position:absolute;
border:1px solid black;
border-bottom-width: 0;
font:normal 9px Verdana;
line-height:18px;
z-index:100;
}

#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
}

#dropmenudiv a:hover{ /*hover background color*/
background-color: yellow;
}

</style>

<script type="text/javascript">

//menu 0
var menu0=new Array()
menu0[0]='<ul><ul id="recently"><BloggerPreviousItems><li><a href="<$BlogItemPermalinkURL$>"><$BlogPreviousItemTitle$></a></li></BloggerPreviousItems></ul>'

//menu 1
var menu1=new Array()
menu1[0]='<ul><BloggerArchives><li><a href="<$BlogArchiveURL$>"><$BlogArchiveName$></a></li></BloggerArchives></ul>'

//menu 2
var menu2=new Array()
menu2[0]='<a href="http://yankees-chick.com/radio.html">Radio</a>'
menu2[1]='<a href="http://yankees-chick.com/video.html">Video Podcasts</a>'

//menu 3
var menu3=new Array()
menu3[0]='<a href="http://feeds.feedburner.com/YankeesChick" title="Subscribe to my feed, Yankees Chick" rel="alternate" type="application/rss+xml"><img

src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="border:0"/></a>'menu3[1]='<a

href="http://add.my.yahoo.com/rss?url=http://feeds.feedburner.com/Yankees Chick" title="Yankees Chick"><img

src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="" style="border:0"/></a>'


//menu 4
var menu2=new Array()
menu4[0]='<!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><table border="1" bgcolor="#eeeeee">
<tr><td nowrap="nowrap" valign="top" align="left" height="32"></td><td nowrap="nowrap"><input type="hidden" name="domains"

value="yankees-chick.blogspot.com"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31"

maxlength="255" value="" id="sbi"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google

Search" id="sbb"></input></td></tr><tr><td>&nbsp;</td><td nowrap="nowrap"><table><tr><td><input type="radio" name="sitesearch" value=""checked

id="ss0"></input><label for="ss0" title="Search the Web"><font size="-1" color="black">Web</font></label></td><td><input type="radio" name="sitesearch"

value="yankees-chick.blogspot.com" id="ss1"></input><label for="ss1" title="Search yankees-chick.blogspot.com"><font size="-1"

color="black">yankeeschick.com</font></label></td></tr></table><input type="hidden" name="client" value="pub-9306521304047602"></input><input type="hidden"

name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="cof"

value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:282;L:http://

yankees-chick.com/bannersm.jpg;S:http://yankees-chick.blogspot.com;FORID:1"></input><input type="hidden" name="hl"

value="en"></input></td></tr></table></form>
<!-- SiteSearch Google -->'


//menu 5
var menu5=new Array()
menu5[0]='<a href="http://yankees-chick.blogspot.com/2005/10/yankees-chicks-baseball-glossary.html" TARGET="_blank">Baseball Glossary</a>'
menu5[1]='<a href="http://www.americanlegends.blogspot.com/" TARGET="_blank">American Legends</a>'
menu5[2]='<a href="http://babesthatlovebaseball.blogspot.com/" TARGET="_blank">Babes That Love Baseball</a>'
menu5[3]='<a href="http://baseballgeeks.com/" TARGET="_blank">Baseball Geeks</a>'
menu5[4]='<a href="http://www.baseballnooz.com/" TARGET="_blank">Baseball Nooz</a>'
menu5[5]='<a href="http://www.beyondtheboxscore.com/" TARGET="_blank">Beyond the Box Score</a>'


//menu 6
var menu2=new Array()
menu6[0]='<a href="http://yankees-chick.com/ads.html">Advertising</a>'
menu6[1]='<a href="http://yankees-chick.com/feedback.html">Feedback</a>'


var menuwidth='150px' //default menu width
var menubgcolor='#eeeeee' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?



var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()"

onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}



</script>

BODY:

<table border="0" align="center" cellpadding="2" cellspacing="2"><tr><td align="center"><a href="default.htm">About</a></td><td align="center"><a

href="default.htm"onClick="return clickreturnvalue()"onMouseover="dropdownmenu(this, event, menu0,'150px')" onMouseout="delayhidemenu()">Recently Posted</a>

</td><td align="center"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1,'150px')

"onMouseout="delayhidemenu()">Archives</a></td><td align="center"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this,

event, menu2, '150px')" onMouseout="delayhidemenu()">Audio/Video</a></td><td align="center"><a href="default.htm" onClick="return clickreturnvalue()"

onMouseover="dropdownmenu(this, event, menu3,'150px')" onMouseout="delayhidemenu()">Subscribe</a></td><td align="center"><a

href="http://yankees-chick.blogspot.com/2005/10/yankees-chicks-baseball-glossary.html" TARGET="_blank">Glossary</a></td><td align="center"><a

href="http://yankees-chick.com/contests.html">Contests</a></td><td align="center"><a href="default.htm" onClick="return clickreturnvalue()"

onMouseover="dropdownmenu(this, event, menu4,'150px')" onMouseout="delayhidemenu()">Search</a></td><td align="center"><a href="default.htm" onClick="return

clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu5,'150px')" onMouseout="delayhidemenu()">Links</a></td><td align="center"><a

href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu6,'150px')

"onMouseout="delayhidemenu()">Contact</a></td></tr></table>