View Full Version : AnyLink JS Drop Down Menu - adds extra folder to links

02-13-2009, 03:19 PM
1) Script Title: AnyLink JS Drop Down Menu

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

3) Describe problem: I was able to get the Drop Down menu to work, but now the links within each menu variable have an extra folder that I didn't put there. So the links go to the wrong spot when published. Has anyone else had this problem? See http://www.cdlbiz.com/form/company/company3.html.

For example, in my JS menu, these are the attributes:
var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
["About Us", "company/company.html"],
["Management Team", "company/team.html"],
["Overview Presentation", "images/FormationOverview_908.ppt"]

Yet if you mouse over the corresponding link when it's published, the "About Us" link goes to www.cdlbiz.com/form/company/company/company.html instead of www.cdlbiz.com/form/company/company.html like its supposed to.

I realized something else. When the original file is not in a subfolder, the links are fine. But when I move the file to a subfolder, it adds an folder to the link. See http://www.cdlbiz.com/form/test.html. The links are how they are supposed to be under the company folder.

Any ideas? I use FrontPage.


02-13-2009, 05:55 PM
Looking at your menu contents file (http://www.cdlbiz.com/form//menucontents.js), the problem is simply the way you've specified the path to the target URL, in this case:

["About Us", "company/company.html"],

Since you've specified a relative URL in the above, it becomes relative/ added to the page the menu is currently being shown at, namely, http://www.cdlbiz.com/form/company/company3.html The two merged creates the double company/ directory you see.

The solution is just to specify absolute URLs inside your menu contents for all links.

02-13-2009, 06:23 PM
It worked. Thanks so much for your help!!