Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Opening page in original browser window from pop up.

Discussion in 'Website Design Forum:' started by Markleshark, Jun 19, 2010.

  1. Markleshark

    Markleshark Junior Member

    Sorry for the rather long thread title.

    I'm currently building a (pretty basic) website for a friends band and when you click on a snippet of a news item it brings up a small pop up box with the full news item (pop up is in Java).

    I want to include a link to their "News Archive" inside this pop up box, but I want that page to open in the original browser window (the one the user was reading before clicking to bring up the news article).

    Is this possible? I've tried

    Code:
    <a href="..." " target="_parent">link</a>
    but that just opens the page inside the pop up window.

    Hope I've been clear enough.

    Thanks in advance,
    Mark.
     
  2. Mark Alexander

    Mark Alexander Senior Member

    You'll need to use Javascript. Something like this.

    _parent is for dealing with frameset stuff, I believe.
     
  3. Markleshark

    Markleshark Junior Member

    Works like a friggin' charm. Thanks my friend.

    Further on to this, would there be a way to close the popup window while opening in that original window? I've tried adding a second 'onclick' to the link and using the below java, but that doesn't seem to work, popup stays open.

    Code:
    onclick="javascript: self.close()"
    Thanks again,
    Mark.
     
  4. Mark Alexander

    Mark Alexander Senior Member

    That function has that already, you just need to pass a second parameter to it.

    e.g.

    Code:
    <a href="openthispage.htm" onclick="return targetopener(this[COLOR=Red][B], 1[/B][/COLOR])">Click Here</a>
    Should work.
     
  5. Kevin

    Kevin Senior Member

  6. Markleshark

    Markleshark Junior Member

    Thanks both.

    I now have the pop up closing on click. Cheers for that Mark.

    I'll maybe look into Fancybox for version 1.1 Onartis, looks rather nice and easy enough to implement.

    Thanks.
     

Share This Page