Results 1 to 2 of 2

Thread: Drop Down Menu Opens new window or tab.

  1. #1
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop Down Menu Opens new window or tab.

    1) Script Title: AnyLink JS Drop Down Menu v2.3

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.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!!

  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

    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:

    Code:
    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:

    Code:
    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.
    - John
    ________________________

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

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
  •