Results 1 to 5 of 5

Thread: AnyLink Vertical Menu (Open in New Window)

  1. #1
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink Vertical Menu (Open in New Window)

    Script: AnyLink Vertical Menu
    http://www.dynamicdrive.com/dynamici...nkvertical.htm

    Hello all you helpful people,

    Here's my issue, and I hope you can help me.
    All I wanna do is use this script, and when clicking on the links, open them in a pop-up window. Sounds simple enough I know... The script works but I can't get it open in another window for some reason. Here is what I tried so far:

    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="OpenNewWindow" target="_blank" onClick="javascript:window.open('http://www.runescape.com'); return false">RuneScape</a>'
    menu1[1]='<a href="http://www.zybez.com">Zybez</a>'
    menu1[2]='<A HREF="http://tip.it/runescape">Tip.It</A>'
    Now... <a href="OpenNewWindow" target="_blank" onClick="javascript:window.open('http://www.runescape.com'); return false">RuneScape</a>.... does work, when it is in the <body>, but when placed here, it does not.

    Secondly I have tried:


    <SCRIPT TYPE="text/javascript">
    <!--
    function popup(mylink, windowname)
    {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
    href=mylink;
    else
    href=mylink.href;
    window.open(href, LastAlliance, 'width=400,height=200,scrollbars=yes');
    return false;
    }
    //-->
    </SCRIPT>

    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<A HREF="www.runescape.com" onClick="return popup(this, 'notes')">RuneScape</A>'
    menu1[1]='<a href="http://www.zybez.com">Zybez</a>'
    menu1[2]='<A HREF="http://tip.it/runescape">Tip.It</A>'
    <A HREF="www.runescape.com" onClick="return popup(this, 'notes')">RuneScape</A> Also works in the <body> but not in this script.

    Does anyone have any suggestions? I am open to anything. It would be most appreciated.

    Thanks very much in advace.
    Last edited by Jam3rai; 10-14-2005 at 02:32 AM.

  2. #2
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Anyone? Please? I'm still working on this. Java can be such a pain! lol

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi;
    Try this:

    Code:
    menu1[0]='<A HREF="www.runescape.com" onClick="return popup(this, \'notes\')">RuneScape</A>'
    Note the backslashes to the left of the apostrophes (').

  4. #4
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ddadmin,

    Thanks very much for your help. Again it is very much appreciated. Unfortunatly I'm still having difficulties. I tried the code you supplied, but no luck. If it is any more help, here is the url of the page I'm trying to do this on: http://home.comcast.net/~lastalliance/toolbar.html and the full url of the page I'm working on is this: http://lastalliance.home.comcast.net.

    I know... people should be anti-frames, lol. If anyone at all has any suggestions, it would just make my day to figure this out.

    Even if someone has an entirely different way of doing this, I would be very happy.
    Thanks again!
    Last edited by Jam3rai; 10-16-2005 at 11:49 PM.

  5. #5
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Omg... Ok, I figured it out. I KNEW it was going to be something really stupid and easy!!! Every type of java script would not make the links open in a new window... all I did was add target="_blank" after the URL.

    Example:
    Code:
    <a href="http://www.google.com" target="_blank">Google</a>
    I just wanted to post back to thank you for trying to help me, and to post what made it work. Just in case anyone else ever comes across this issue, they will know what to do now. I hope this helps someone!

    PS: Don't laugh at me cause it was so simple! lol

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
  •