Results 1 to 3 of 3

Thread: anylinkmenu2 name confusion / set up question

  1. #1
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default anylinkmenu2 name confusion / set up question

    1) Script Title: Anylink Drop Down Menu

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

    3) Describe problem:

    I have uploaded this and run a test page (see http://www.trackermo.com/testjs.html) but when I try to edit the menucontents.js and repeat any of the drop-down menus, I run into trouble. (FYI: I am trying to simplify the menus in left column of my index page, www.trackermo.com especially under Top Ranks. I would like each heading -- Safelists, Traffic Exchanges, etc. -- to have a drop-down menu.)

    I am a bit confused anyway, because the name "anylinkmenu" is used so many different ways. Then it says, "Make sure "anylinkmenu1" is a unique name!"... as in:

    var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
    anylinkmenu1.items=[
    ["Dynamic Drive", "http://www.dynamicdrive.com/"],
    ["CSS Drive", "http://www.cssdrive.com/"],
    ["JavaScript Kit", "http://www.javascriptkit.com/"],
    ["Coding Forums", "http://www.codingforums.com/"],
    ["JavaScript Reference", "http://www.javascriptkit.com/jsref/"] //no comma following last entry!
    ]



    var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
    anylinkmenu2.items=[
    ["CNN", "http://www.cnn.com/"],
    ["MSNBC", "http://www.msnbc.com/"],
    ["Google", "http://www.google.com/"],
    ["BBC News", "http://news.bbc.co.uk"] //no comma following last entry!
    ]
    When I change the "anylinkmenu2=" to "myownname=" it doesn't work. (And, yes, I changed it in both instances, i.e., "myownname={divclass..." and "myownname.items=[..."

    Is there somewhere else it needs to change? That is, such as in the command within the actual page (below)?

    Also, in the instructions, it says:

    <!--2nd anchor link-->

    <p><a href="http://www.dynamicdrive.com" class="menuanchorclass someotherclass" rel="anylinkmenu2[click]" rev="lr">Right dropping menu</a> (click to reveal)</p>
    What does someotherclass refer to? Is that something that needs to be changes, as well?

    Any help would be much appreciated.


    Mo

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

    Default

    Firstly, you should remove the duplicate code near the bottom of your page:
    Code:
    <script type="text/javascript">
    
    //anylinkmenu.init("menu_anchors_class") //call this function at the very *end* of the document!
    anylinkmenu.init("menuanchorclass")
    </script>
    The init() function should never be called more than once on the same group of class name (in this case, "menuanchorclass").

    As far as:

    What does someotherclass refer to? Is that something that needs to be changes, as well?
    You can remove that class if you want. It's there simply to illustrate that you can insert multiple CSS classes into an element.
    DD Admin

  3. #3
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, thanks!

    I took out that code and that seems to have done the trick.

    I think that was left over from the earlier version.... at least, I know I didn't add it recently. But I had tried to use this script earlier in the year. I also seemed to have managed the naming convention... I think I suspected THAT when, in fact, it was the extra ini command.

    Thanks again!

    Mo

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
  •