Results 1 to 2 of 2

Thread: Any link drop down menu, menu won't drop down ...Help!

  1. #1
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Any link drop down menu, menu won't drop down ...Help!

    1) Script Title: Any link drop down menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem: The menu part seems to look fine but when I try to hover over it the drop down menu doesn't seem
    to work, I'm going to post a link to my site as well as the sourse code, if someone could tell me how to fix this problem that
    would be great, thankyou.

    http://www.carrieszczepanski.org

    Code:
    <style type="text/css">
    
    #dropmenudiv{
    position:absolute;
    font-family: small fonts;
    font-size: 5pt;
    letter-spacing: 1px;
    line-height:15px;
    z-index:100;
    }
    
    #dropmenudiv a{
    border-bottom: 1px dotted #000000;
    color: #71221d;
    display: block;
    font-family: small fonts;
    font-size: 5pt;
    letter-spacing: 1px;
    padding: 1px 0;
    text-decoration: none;
    text-indent: 3px;
    text-transform: uppercase;
    }
    
    #dropmenudiv a:hover{ /*hover background color*/
    background-color: #aa802e;
    color: #71221d;
    font-family: small fonts;
    font-size: 5pt;
    letter-spacing: 1px;
    text-transform: uppercase;
    }
    
    </style>
    
    /***********************************************
    * AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.carrieszczepanski.org/aboutme.htm">About Me</a>'
    menu1[1]='<a href="http://www.carrieszczepanski.org/thename.htm">Name Analysis</a>'
    menu1[2]='<a href="http://www.carrieszczepanski.org/lifeslist.htm">Life's List</a>'
    menu1[3]='<a href="http://www.carrieszczepanski.org/poetry.htm">Poetry</a>'
    menu1[4]='<a href="http://www.carrieszczepanski.org/cdcollection.htm">CD Collection</a>'
    menu1[5]='<a href="http://www.carrieszczepanski.org/moviecollection.htm">Movie Collection</a>'
    menu1[6]='<a href="http://www.carrieszczepanski.org/mysoundtrack.htm">My Soundtrack</a>'
    menu1[7]='<a href="http://www.carrieszczepanski.org/mytopten.htm">My Top Ten</a>'
    menu1[8]='<a href="http://www.carrieszczepanski.org/50questions.htm">50 Questions</a>'
    menu1[9]='<a href="http://www.carrieszczepanski.org/questionsandanswers.htm">?'s and Answers</a>'
    
    //Contents for menu 2, and so on
    var menu2=new Array()
    menu2[0]='<a href="http://www.carrieszczepanski.org/photoarchive/" target="_blank">Photo Archive</a>'
    
    //Contents for menu 3, and so on
    var menu3=new Array()
    menu3[0]='<a href="http://www.carrieszczepanski.org/graphics/" target="_blank">Graphics Archive</a>'
    menu3[1]='<a href="http://www.carrieszczepanski.org/screencaptures/" target="_blank">ScreenCapture Archive</a>'
    menu3[2]='<a href="http://www.carrieszczepanski.org/videos/" target="_blank">Video Archive</a>'
    menu3[3]='<a href="http://www.carrieszczepanski.org/winthisaward.htm">Win this Award</a>'
    menu3[4]='<a href="http://www.carrieszczepanski.org/tutorials.htm">Tutorials</a>'
    menu3[5]='<a href="http://www.carrieszczepanski.org/healthandbeauty/">Health & Beauty</a>'
    menu3[6]='<a href="http://www.carrieszczepanski.org/cookingclass/">Cooking Class</a>'
    menu3[7]='<a href="http://www.carrieszczepanski.org/goodreads/">Good Reads</a>'
    
    //Contents for menu 4, and so on
    var menu4=new Array()
    menu4[0]='<a href="http://www.carrieszczepanski.org/thedomain.htm">About this Domain</a>'
    menu4[1]='<a href="http://www.carrieszczepanski.org/awards.htm">Awards</a>'
    menu4[2]='<a href="http://www.carrieszczepanski.org/hosting.htm">Hosting</a>'
    menu4[3]='<a href="http://www.carrieszczepanski.org/hosted.htm">Hosted</a>'
    menu4[4]='<a href="http://www.carrieszczepanski.org/layoutarchive.htm">Layout Archive</a>'
    menu4[5]='<a href="http://www.carrieszczepanski.org/advertise.htm">Advertise</a>'
    menu4[6]='<a href="http://www.carrieszczepanski.org/credits.htm">Credits</a>'
    menu4[7]='<a href="http://www.carrieszczepanski.org/disclaimer.htm">Disclaimer</a>'
    menu4[8]='<a href="http://www.carrieszczepanski.org/linkhere.htm">Link Here</a>'
    menu4[9]='<a href="http://www.carrieszczepanski.org/sitecollective.htm">Site Collective</a>'
    
    //Contents for menu 5, and so on
    var menu5=new Array()
    menu5[0]='<a href="http://www.carrieszczepanski.org/memberships.htm">Memberships</a>'
    menu5[1]='<a href="http://www.carrieszczepanski.org/links.htm">Links</a>'
    menu5[2]='<a href="http://www.carrieszczepanski.org/listed.htm">Listed</a>'
    menu5[3]='<a href="http://www.carrieszczepanski.org/favourites.htm">Favourites</a>'
    menu5[4]='<a href="http://www.carrieszczepanski.org/resources.htm">Resources</a>'
    		
    var menuwidth='165px' //default menu width
    var menubgcolor='#3a3437'  //menu bgcolor
    var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick="yes" //hide menu when user clicks within menu?
    
    /////No further editting needed
    
    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)
    }
    
    if (hidemenu_onclick=="yes")
    document.onclick=hidemenu
    
    </script>
    
    </head>
    
    </body>
    
    <!-- START NAVIGATION -->
    
    <table width="100%" cellpadding="0" cellspacing="1" align="center" class="navigation">
    
       
     <tr>
      <td><div id="nav"><a href="http://www.carrieszczepanski.org/">Main</a></div>   </td>
    
      <td><div id="nav"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()">Carrie</a></div> </td>
    
      <td><div id="nav"><a href="http://www.carrieszczepanski.org/photoarchive/" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()">Gallery</a></div> </td>
    
      <td><div id="nav"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu3, '150px')" onMouseout="delayhidemenu()">Visitor</a></div> </td>
    
      <td><div id="nav"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()">Domain</a></div>  </td>
    
      <td><div id="nav"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu5, '150px')" onMouseout="delayhidemenu()">Web</a></div> </td>
    </tr>
    
     </table>
    
    <!-- END NAVIGATION -->

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    There's an error in your menu contents. Any single quotes within them need to be backslashed, so for example:

    Code:
    menu1[2]='<a href="http://www.carrieszczepanski.org/lifeslist.htm">Life\'s List</a>'
    Do this for any other occurences of single apostrophes/ quotes in menu[].
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •