View Full Version : AnyLink JS Drop Down Menu v2.2 new window only working

10-06-2010, 09:04 PM
1) Script Title: AnyLink JS Drop Down Menu v2.2

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

3) Describe problem: The menu only works by launching new windows for each link clicked. I know you are suppose to change the code from the linktarget:'_new' to linktarget:'' but it doesn't work it breaks the links. I even tried "_self" and "self" and those just break the links. It only works opening a new window. Any ideas?

var anylinkmenu5={divclass:'anylinkmenu', inlinestyle:'width:135px; background:#ced9e2', linktarget:'_new'}

10-07-2010, 02:49 AM
try this one:


10-07-2010, 07:38 AM
If I understand the OP correctly, you don't want the links to open in any kind of new or secondary window right, just in the current? linktarget:'' should work in doing that. Please post a link to the page on your site that contains the problematic script so we can check it out.

10-07-2010, 02:24 PM
Yes that is correct, I want all drop down links to target the current window and no secondary windows. When I leave it as linktarget:'sewin' or 'new' the menu works but when I change it to linktarget:'' the link is broken.

You can see what I have here:

Thanks very much for taking a look!

10-07-2010, 06:36 PM
Thanks but linktarget:'_blank' still opens it in a new window.

Any other ideas?

10-07-2010, 08:28 PM
Do not add _blank.

10-07-2010, 10:12 PM
I guess my response didn't go through but removing the _blank doesn't help. The menu only works when _secwin or _new is there. Left with just '' shows a broken link.

Any other ideas?

10-08-2010, 08:01 AM
By looking at your page, as far as I can tell the script is working fully actually. The menu links do open in the same window as the menu itself. The reason why they are broken links then is simply due to the way you've defined their URLs inside menucontents.js. Take the first drop down menu for example, which draws from the following chunk of code:

var anylinkmenu4={divclass:'anylinkmenu', inlinestyle:'width:225px; background:#ced9e2', linktarget:''} //Second menu variable. Same precaution.
["Achievement Gap", "achievementgap.html/"],
["School Turnaround Nationally", "stnationally.html/"],
["School Turnaround in Massachusetts", "stma.html/"],
["School Turnaround in the News", "stnews.html/"] //no comma following last entry!

The first link "achievementgap.html/" when fully constructed translates to http://www.cviscusi.com/UnlockingPotential/achievementgap.html/, which is a broken link. You should take out the trailing "/" in all of your links inside menucontents.js