Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jun 2008
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Open pop-up in same window

    I would like to open a pop-up in the same window from which it was called. Is this possible?
    Thanks all

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,603
    Thanks
    80
    Thanked 4,500 Times in 4,464 Posts
    You mean a "POP ON". A popup is by definition a new window. A popon is just a <DIV> (or similar) that is absolutely positioned on the page and which has a z-index that puts it in front of the rest of the page.

    Here's a website where I did that, recently:
    http://www.artsofsnohomish.org/index.asp

    Look down the page for the 3 artists' names (e.g., "Janie Olsen") and click on one. There you go. A popon.

    Look quick because that site gets changed to another show by Monday night.

    Feel free to steal the code.

  • #3
    New Coder
    Join Date
    Jun 2008
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Must be making stupid mistake because i can't get it to function?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,603
    Thanks
    80
    Thanked 4,500 Times in 4,464 Posts
    Show what you used/coded???

    Can't guess from no information.

  • #5
    New Coder
    Join Date
    Jun 2008
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I have been trying to use without success the following:

    Code:
    <a href="#" onclick="return artist(this,2);"><b>My Name</b></a>

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,603
    Thanks
    80
    Thanked 4,500 Times in 4,464 Posts
    Please show how you *ADAPTED* my code to your page.

    SURELY you wouldn't have 3 "artist" divs as I did. Why would you name your function artist( )???

    If you didn't adapt the code, then you need to.

    Try showing the FULL CODE.

  • #7
    New Coder
    Join Date
    Jun 2008
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi Old Pendant
    I was not using your code as is. I just tried to you what line of code that i was using.

    At the moment i am using the following:
    Code:
    <javascript language="javascript">
    function fingers_crossed(){
    lets_hope = window.open ("tester.html","lets_hope");
    "height=210,width=425,resizable=0,menubar=0,toolbar=0,location=0,directories=0,
    scrollbars=0,status=0,left=350,top390");
    }
    </script>
    Finally,
    Code:
    <a href="javascript: self.close()">Click here to close</a>
    I can now get the pop-uo to appear in the window from which it was called but it looks completely different from the ones you created?

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,603
    Thanks
    80
    Thanked 4,500 Times in 4,464 Posts
    Um...no...that *does* open a NEW WINDOW. It is not "in the same window from which it was called." But if that's good enough for you, just use that.

  • #9
    New Coder
    Join Date
    Jun 2008
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hiya Old Pendant
    I would prefer to do it as you have but some how i get lost along the way and was hoping that you just might show me how by altering the code i posted previously. Big thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •