Results 1 to 6 of 6

Thread: AnyLink Drop Down Menu: links in new window?

  1. #1
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink Drop Down Menu: links in new window?

    1) Script Title: AnyLink Drop Down Menu (onMouseover)

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

    3) Describe problem: Everything works fine, but how can I have the links opened in a new browser window?
    (Please, be very explicit in your answer, as I only know how to 'copy/paste' Javascript)

    Thanks for any reply!

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,859
    Thanks
    49
    Thanked 260 Times in 252 Posts
    Blog Entries
    56

    Default

    Put:
    <base target="_new">
    just below <html> (beginning of page).

    Arie Molendijk.

  3. #3
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, never heard about this, but... it works!
    Disadvantage: ALL links are now placed in a new window (even the anchors) - I don't know if there is a solution to that?
    In other words: can this line be added somewhere in the javascript code? (or some other change?)

    Thanks for your help!
    Last edited by bizy; 11-19-2007 at 11:48 PM.

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,859
    Thanks
    49
    Thanked 260 Times in 252 Posts
    Blog Entries
    56

    Default

    If you want to treat links individually, leave out the 'base target line'.
    Somewhere in your file you have links like:

    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
    menu1[1]='<a href="http://www.freewarejava.com">Freewarejava.com</a>'
    menu1[2]='<a href="http://codingforums.com">Coding Forums</a>'
    menu1[3]='<a href="http://www.cssdrive.com">CSS Drive</a>'
    etc.

    If you want to open, say, the first item and the third item in a new window, replace the preceding lines with:
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.javascriptkit.com" target="_new">JavaScript Kit</a>'
    menu1[1]='<a href="http://www.freewarejava.com">Freewarejava.com</a>'
    menu1[2]='<a href="http://codingforums.com" target="_new">Coding Forums</a>'
    menu1[3]='<a href="http://www.cssdrive.com">CSS Drive</a>'

  5. #5
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you!

    This can surely do. I'd still like to ask: is there a way to have all links of all menus opened in a new window, excluding all other links on the page (including anchors)?

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,859
    Thanks
    49
    Thanked 260 Times in 252 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by bizy View Post
    ... is there a way to have all links of all menus opened in a new window, excluding all other links on the page (including anchors)?
    I think so, but this would make things more complicated than simply having to add ' target="_new" '.

    Arie M.

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
  •