Results 1 to 5 of 5

Thread: Open links in new window

  1. #1
    Join Date
    Jul 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Open links in new window

    1) Script Title: Open links in new window

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/newwindow.htm

    3) Describe problem: I have two questions. 1. How can I get rid of the check box, I just want the links to automatically open in a new window. 2. I'm trying to open all links in the same new window. This worked fine until I added a jump menu. The jump menu opens the links in the same page.

    Thanks Matt

  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

    1 ) Delete the checkbox from the page and get rid of the red part in this function:

    Code:
    function inithyperlinks(){    //DynamicDrive.com added routine
    if (document.targetform.targetnew.checked)
    hyperlinks(true)
    }
    2 ) Edit the jump menu to open links in the same new window. To help more on this part, I would need to see your jump menu (its script and possibly its markup as well). A link to your live page would be fine as long as the code I need to see is on or linked to it.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the help on the first question, it worked great. Here's a link to a page with some jump menus, http://affiliates.vilasonline.org/ki.../kg_week_1.htm.

    Matt

  4. #4
    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

    Find this function:

    Code:
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
    }
    Change it to:

    Code:
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    var thewin=window.open(selObj.options[selObj.selectedIndex].value,targ);
    thewin.focus();
      if (restore) selObj.selectedIndex=0;
    }
    Make your onchange events look like so:

    Code:
    onchange="MM_jumpMenu('window2',this,0)"
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Works great...thank you very much for the help.

    Matt

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
  •