SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Addict michaelwheaton's Avatar
    Join Date
    Jan 2001
    Location
    Alberta, Canada
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript pop-up help...

    A website I am currently working on opens up pop-up windows to show a larger view of the product. A while ago I saw a website that did the same thing, only when the user clicked back onto the main window (not the pop-up) the pop-up closed itself. So as soon as the user was done with the pop-up and began navigating the rest of the site, to window would just close itself. How would I do this?

    Thanks,
    Michael

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    <body onUnload="popupwindowname.close()">
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want the popup to close itself without closing the parent, you can use this body tag in your popup html:

    <body onblur="self.close()">

  4. #4
    SitePoint Addict michaelwheaton's Avatar
    Join Date
    Jan 2001
    Location
    Alberta, Canada
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help, it's working great now.

  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You are welcome, glad we could help
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


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
  •