Results 1 to 5 of 5

Thread: Anylink Drop Down not working in subdirectories

  1. #1
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Anylink Drop Down not working in subdirectories

    1) Script Title: Anylink Drop down menu

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

    3) Describe problem: Drop down does not appear when I link to it in subfolders. I realize I have to update the links, but couldn't seem to locate the missing code. I realize this is probably a pretty stupid question, but it's in fact driving me nuts, and any help is appreciated. A link to a page that is not functioning is http://www.mikegrantonline.com/login/clients.html --- The top three tabs should be dropping down as seen on the homepage. Thanks in advance.

    Mike

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Your page is in violation of Dynamic Drive's usage terms, which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.


    You may take care of the above violation by changing the external tag from (and similar) on all pages using this menu:

    HTML Code:
    <script src="../js/dropdown.js" type="text/javascript"></script>
    to:

    HTML Code:
    <script src="../js/dropdown.js" type="text/javascript">
    
    /***********************************************
    * 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
    ***********************************************/
    
    </script>
    Also, this:

    Code:
    <!--
    and this:

    Code:
    //-->
    don't belong in the external script file.

    On to your problem - Where you have:

    Code:
    dropdownmenu(this, event,'../menu1', '135px')
    and similar, it should be:

    Code:
    dropdownmenu(this, event,menu1, '135px')
    Since you are accessing the same menu from the same script, no path is required. In fact, that part of the call is not a path at all but a reference to an array. In the case of the example above, it is this array (from the script):

    Code:
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="about.html">About Mike Grant</a>'
    menu1[1]='<a href="resume.html">View Resume</a>'
    That's where the path will matter. Since you are using it from a different folder and it is referencing pages in the root, the network path will do for any page in any folder (including the root) on the site:

    Code:
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="/about.html">About Mike Grant</a>'
    menu1[1]='<a href="/resume.html">View Resume</a>'
    One other thing about this script that has nothing to do with your problem is that it has always had a minor error here:

    Code:
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    That line should be:

    Code:
    dropmenuobj.style.left=dropmenuobj.style.top='-500px';
    This might never cause an issue with your particular installation, but it might. So may as well take care of it now.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Hi John,
    Thanks for your quick reply. In response --

    1. Sorry about the notice, I didn't realize it should even appear on external linked files. I'll put it in there.

    On to the problem --
    2. When dreamweaver 'updated my links' I saw it updated the '../menu1' etc. arrays, I thought this was odd, and changed it, but it did not work, so I changed it back to the way it was. Anyhow, I modified it like you suggested, and am still not seeing my drop down, any other thoughts?? Thanks in advance..

    Mike

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Mng026 View Post
    Anyhow, I modified it like you suggested
    I don't think so, remove the quote marks so that it looks like what I put in my post. Do it like this:

    Code:
    dropdownmenu(this, event,menu1, '135px')
    Not like you currently have it:

    Code:
    dropdownmenu(this, event,'menu1', '135px')
    Thanks for fixing the credit.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Mng026 (08-05-2008)

  6. #5
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    oops! Dreamweaver must of added the '' when it changed the array to a link -- that did the trick indeed! Thanks a bunch.

    Mike

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
  •