Results 1 to 5 of 5

Thread: Open Certain Links in a New Window - AnyLink Menu

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

    Unhappy Open Certain Links in a New Window - AnyLink Menu

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

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem: We have been searching the forums here and cannot find a way to make only CERTAIN items in the drop menu open in a new window.

    We have already tried this:

    var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
    anylinkmenu1.items=[
    ["Item 1", "google.com", "", "_blank"],
    ["Item 1", "google.com", "", "_self"]
    ]

    We have also tried this:

    var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
    anylinkmenu1.items=[
    ["Item 1", "google.com", "_blank"],
    ["Item 1", "google.com", "_self"]
    ]

    These are based on posts in this forum. None of these options work for both IE and Firefox.

    Can anyone tell us how to write this properly?

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    There is another version of the anylink menu where the menu items are in the html and not in a separate menucontents.js file. You can find the script here:
    http://www.dynamicdrive.com/dynamici...anylinkcss.htm

    if you don't specify the target it will open in the same window, but you can get it to open in a new window like this
    Code:
    <div class="column">
    	<b>Web Development</b>
    	<ul>
    	<li><a href="http://www.dynamicdrive.com/" target="_blank">Dynamic Drive</a></li>
    	<li><a href="http://www.cssdrive.com">CSS Drive</a></li>
    	<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
    	<li><a href="http://www.codingforums.com">Coding Forums</a></li>
    	<li><a href="http://www.javascriptkit.com/domref/">DOM Reference</a></li>
    	</ul>
    </div>
    in this example only the red link opens in a new window. It works in both IE and firefox

  3. #3
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you and we have seen that, however this code has been implemented on a 200+ page website and it is imperative that the menus are in an external file so unfortunately deploying a completely different menu is not an option.

    Do you know how to code this version so it works?

  4. #4
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    No I don't know, but I found this thread
    http://www.dynamicdrive.com/forums/s...ad.php?t=54627
    and it seems like DD has made a modification of the script that should fix it. You could give it a try !

  5. #5
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah that worked! I did see this post when doing research however I failed to see there was a new anylinkmenu.js file. That was why it did not work.

    Thanks for helping, it is much appreciated.

    For anyone who has this problem in the future -- be sure to download the new .js file as found at the end of the post in the link above.

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
  •