PDA

View Full Version : Drop Down Menu Opens new window or tab.



crabjoe
12-15-2011, 07:14 PM
1) Script Title: AnyLink JS Drop Down Menu v2.3

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

3) Describe problem:

I'm not sure what the problem is and I'm hoping someone can help me.

I'm using anylinkmenu4 (uses image to drop a menu from it) and all works fine except for one problem.

When I click on a menu item in the dropdown, a new browser window opens in IE. Using firefox, a new tab opens. What's really odd is that is I select a link from the dropdown in the new browser tab or window that opens, it works find... Basically the link url opens fine in that same browser instance. If I go back to the original browser and select a different link, it update the new brower window/tab.

Does anyone know what might be causing this and how I might go about fixing it? Might there be some code I could I to force it to use the same browser instance?

Thanks!!

jscheuer1
12-15-2011, 07:36 PM
There are at least two versions of Anylink. If in fact you're using the AnyLink JS Drop Down Menu v2.3 that you link to in your post, where you have stuff like this:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //First menu variable. Make sure "anylinkmenu1" is unique
anylinkmenu1.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!
]

Change that to _self:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_self'} //First menu variable. Make sure "anylinkmenu1" is unique
anylinkmenu1.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!
]

The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.