PDA

View Full Version : AnyLink JS Drop Down Menu v2.2 opens in new window



joeweb
08-26-2009, 04:42 PM
1) Script Title:
AnyLink JS Drop Down Menu v2.2 - menucontents.js
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
3) Describe problem:
when i use the "Menu with multiple columns" example on dynamic drive and when i test it on my site, the links in the dropdown always open in a new window. (the links in the "Default example" open in the same window, just fine.)

at the top of menucontents.js is the line:

var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'}

whether i change linktarget property from _new to _self, _parent, or _top makes no difference. the links still open in a second window.

any suggestions on how to open the dropdown links in the current window?

thank you very much

joeweb
08-26-2009, 07:03 PM
as a follow-up to my question above -- once the initial link opens in a new window, all subsequent links continue opening in this same window.

the problem is, i still have the home page sitting in that very first window in the background. i tried naming the original "home" window and targeting that name (as described in the link below) but this did not work:

http://www.irt.org/script/263.htm

ddadmin
08-27-2009, 02:40 AM
If you're asking how to get the links to simply open in the same window as the menu page, you should set linktarget to '', for example:


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!
]

Do this for all other menus defined within menucontents.js

joeweb
08-27-2009, 12:07 PM
thank you for your response but leaving the single quotes blank for linktarget doesn't solve it either.

once the first dropdown link pops up a new window, all the other dropdown links from each of the menus open in this new window just fine - but the original home page is still in the background.

and when i bring that original home page to the front and click any link on any of the drop down menus, they still open in the popup window rather than the original homepage window.

joeweb
08-27-2009, 12:26 PM
hi ddadmin,

i was certain that i tried leaving the linktarget blank and that failed yesterday - but now it appears to be working.

thank you!!