Results 1 to 3 of 3

Thread: Weird Problem with AnyLink Vertical

  1. #1
    Join Date
    Oct 2008
    Location
    Chicago
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Weird Problem with AnyLink Vertical

    AnyLink Vertical Menu
    http://www.dynamicdrive.com/dynamici...nkvertical.htm


    OK... very odd and I can't quite figure this out.

    I am using this on my left nav bar which has image buttons, and on one button on my right bar.

    I have a total of 17 menu arrays.

    If I use the first one on the left plus the one on the right, it works. The links are in 2 separate .php includes, and I'm wondering if that's why.

    When I add the other 15 menu arrays to my external java file, none of them work.

    I am tormented...HELP!

    The page I'm playing with this on is http://roses-and-teacups.com/CSSHome3.php



    here is my external file with 5 of the menu arrays (doesn't work this way, either, so I'm shortening it.)

    /***********************************************
    * 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://roses-and-teacups.com/aprons.php">Aprons</a>'
    menu1[1]='<a href="http://roses-and-teacups.com/hats-victorian-bridal.php">Hats &amp; More Hats!</a>'
    menu1[2]='<a href="http://roses-and-teacups.com/romantic-victorian-home.php">Purses &amp; Vanities</a>'
    menu1[3]='<a href="http://roses-and-teacups.com/red-hats.php">Red Hats &amp; Red Hat Clothing</a>'
    menu1[4]='<a href="http://roses-and-teacups.com/victorian-red-hat-accessories.php">Victorian Hats &amp; Accessories</a>'
    menu1[5]='<a href="http://roses-and-teacups.com/victorian-style-clothing.php">Victorian Clothing</a>'

    //Contents for menu 2
    var menu2=new Array()
    menu2[0]='<a href="http://roses-and-teacups.com/babies-girls-victorian.php">Heirloom Baby Ensembles</a>'
    menu2[1]='<a href="http://roses-and-teacups.com/heirloom-gowns.php">Heirloom Christening Gowns</a>'

    //Contents for menu 3
    var menu3=new Array()
    menu3[0]='<a href="http://roses-and-teacups.com/romantic-victorian-bride.php">Bridal Accessories & Favors</a>'
    menu3[1]='<a href="http://roses-and-teacups.com/bridal-hats-purses.php">Bridal Hats</a>'
    menu3[2]='<a href="http://roses-and-teacups.com/bridal-hats-purses.php">Bridal Purses</a>'
    menu3[3]='<a href="http://roses-and-teacups.com/hat-pins-hatpins.php">Hatpins</a>'
    menu3[4]='<a href="http://roses-and-teacups.com/romantic-victorian-decor.php">Keepsake Boxes</a>'
    menu3[5]='<a href="http://roses-and-teacups.com/romantic-victorian-bride.php">Photo Albums</a>'
    menu3[6]='<a href="http://roses-and-teacups.com/lavender-sachets-soaps.php">Victorian Sachets</a>'
    menu3[7]='<a href="http://roses-and-teacups.com/white-bridal-tea.php">White Teaware</a>'

    //Contents for menu 4
    var menu4=new Array()
    menu4[0]='<a href="http://roses-and-teacups.com/broken-to-beautiful-angels.php">China Angels</a>'
    menu4[1]='<a href="http://roses-and-teacups.com/my-victorian-desk.php">China Calling Card Holders</a>'
    menu4[2]='<a href="http://roses-and-teacups.com/broken-china-jewelry.php">China Jewelry</a>'
    menu4[3]='<a href="http://roses-and-teacups.com/mosaic-table-art.php">Mosaic Art & Decor</a>'
    menu4[4]='<a href="http://roses-and-teacups.com/spoon-bracelets.php">Silver Spoon Bracelets with Charms</a>'

    //Contents for menu 5
    var menu5=new Array()
    menu5[0]='<a href="http://roses-and-teacups.com/carols-rose-garden.php">Address Books</a>'
    menu5[1]='<a href="http://roses-and-teacups.com/carols-rose-garden.php">Carol’s Rose Garden</a>'
    menu5[2]='<a href="http://roses-and-teacups.com/carol-wilson-2.php">Fancy Notelets</a>'
    menu5[3]='<a href="http://roses-and-teacups.com/carol-wilson-cards.php">Greeting Cards</a>'
    menu5[4]='<a href="http://roses-and-teacups.com/carol-wilson-specialty.php">Jewel Box Notes</a>'
    menu5[5]='<a href="http://roses-and-teacups.com/carols-rose-garden.php">Journals</a>'
    menu5[6]='<a href="http://roses-and-teacups.com/carol-wilson-specialty.php">Letters of Note</a>'
    menu5[7]='<a href="http://roses-and-teacups.com/carol-wilson-2.php">Little Notes</a>'
    menu5[8]='<a href="http://roses-and-teacups.com/carols-rose-garden.php">Magnetic Notepads</a>'
    menu5[9]='<a href="http://roses-and-teacups.com/carol-wilson.php">Note Card Portfolios</a>'
    menu5[10]='<a href="http://roses-and-teacups.com/christian-gifts-favors.php">Scripture Portfolios</a>'
    menu5[11]='<a href="http://roses-and-teacups.com/carol-wilson-specialty.php">Teapot and Floral Portfolios</a>'
    menu5[12]='<a href="http://roses-and-teacups.com/carol-wilson-2.php">Thank You Notes</a>'
    menu5[13]='<a href="http://roses-and-teacups.com/CSSChristmas.php">Carol Wilson Christmas!</a>'


    var menuwidth='300px' //default menu width
    var disappeardelay=600 //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick="yes" //hide menu when user clicks within menu?
    var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

    /////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: 160px" 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=-500
    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-obj.offsetWidth < 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 menu up?
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
    edgeoffset=dropmenuobj.y
    }
    }
    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")+obj.offsetWidth+horizontaloffset+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"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)
    }

  2. #2
    Join Date
    Oct 2008
    Location
    Chicago
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Plot thickens...

    Ok, no matter that I leave everything else exactly the same...if I take out menu arrays 2-16, 1 and 17 work. If I just copy and paste them back in... nothing works.

  3. #3
    Join Date
    Oct 2008
    Location
    Chicago
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Fixed it with forums archives!

    Yea!! Didn't know that you can't have single apostrophes in javascript, but discovered it as I surfed the forums!!

    Fantastic!! All 17 drop downs work!!

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
  •