SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anybody help me, please??!!!

    On my web designer site, I have several links on the services page which open up in a pop-up window. This works fine with Windows ME as each link is opened in the previous pop-up if it's not closed by the user before hand. However, a friend of mine tells me that in Win95 and Win98, each link opens in a separate pop-up, so when he's finished looking at the site, and closes the main window, he has loads of pop-up's to close down too!

    This is the pop-up javascript I use:

    function openWindow1(url_param) {

    var popupWin = null;
    popupWin = window.open(url_param, 'remote', 'width=400,height=375,resizable=no,menubar=no,toolbar=no,left=10,top=10,scrollbars=yes')
    popupWin.opener.name="main";
    popupWin.focus();
    }

    Does anybody know how I can modify it for win95/98 OR give me a code that will close down all pop-ups when the main window is closed.

    Thanks a lot.
    Saz
    The Postfive Website
    Postfive Publishing

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, you could also try putting an event handler that would close the window when focus is taken away from it.

    onBlur:self.close

    Or, the way you are wanting to do it would be something like this:

    if (window.parent.close) {
    self.close
    }

    The code is probably not right, but that should get you headed in the right direction.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Creole...........I'll give it a go!!!!

    Saz

  4. #4
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can close a window before opening a new one.

    something like

    window.close(self)

    You can implement it for example : onClick="window.close(self)"
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  5. #5
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've semi sort of solved the problem. The pop-ups now close on blur, which will do for a short term fix. I'm still trying to work out a way to get the pop-ups to close when the parent window is clicked on only, and not anywhere on the screen!!

    When I made the pop-ups, I did actually include a self.close button within each, but I guess you have to allow for the people who don't use them!!!!


    Saz
    The Postfive Website
    Postfive Publishing

  6. #6
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when the parent iwndow is lcicked upon? use onFocus then.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  7. #7
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HELP!

    Is there any way of making the parent window close, without getting the alert box saying "The Web Page is trying to close this window yes/no"?

    Or is there anyway of automatically saying yes!?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  8. #8
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blimey...you dragged this one up from the depths didn't you?! This was one of my first posts!

    I'm not sure what you mean here Matt.

    I know if you open a window manually that is usually opened with a javascript pop-up, you'll get this prompt when you try to close it, but I'm not aware of any way round it.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  9. #9
    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)
    weird: the parent window closing is a user security default and can't be overriden without activex (which the user will need to approve anyways).
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  10. #10
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Saz249
    Blimey...you dragged this one up from the depths didn't you?! This was one of my first posts!

    I know! I always try and do a search before posting a new thread, in case it has already been covered. This seemed like a good enough place as any, especially as you clever people should have been subscribed!!

    I think Jeremy answered my question for me, and it was the answer I didn't want to hear! Basically I need to open the main site in an approiately sized window, but I don't want people thinking it is just another annoying popup and automatically close it, so I figured if I could close the parent window, then it might help with that.

    So it doesn't work, window.opener.close, window.parent.close, window.close, any of it -- it still gives me the alert box, which would freak users out even more...

    In that case if I am using window.resizeTo(400,400)

    is there anyway I can at the same time take off things like the address bar/menu bar, or is that again something to do with the parent window, and it's not going to let me?
    Last edited by weirdbeardmt; Sep 4, 2001 at 06:16.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  11. #11
    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)
    yeah, window settings are assigned when a window is created. So, your idea about opening a new window and closing the parent is a good one in terms of your site, but what about when users leave your site? It's not nice to limit their experience
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  12. #12
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hadn't actually thought of that. I could leave the address bar in (or provide a breakout of this design link)...

    Is there anyway I can do this? Because at the moment, the page will not fit on to a screen at 800x600 if it has the extra browser bits there.

    I might have to leave it as is -- that is that a splash page loads, which then automatically launches the sized window, and just hope people don't close (there are links on the splash page to reopen the window, should they close it...I just dont like splash pages!)

    Any ideas?!
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  13. #13
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it really, really necessary to have this site open in a set sized window? Would it not work if it was done in a centered 400x400 table?

    If you have to do it this way, then why not create an opening page (yuk! I hate them and can't even believe I'm suggesting this, but that's just my personal preference!) with a link to open the main site? At least this way, when the window appears users will know that it's not your regular annoying pop-up!

    <edit>
    damn...I hate it when I click submit and find someone has posted after I last read the thread!

    Ok...so you already have the spash page...just take away the auto-open so users have to do it theirselves.
    Last edited by Saz249; Sep 4, 2001 at 06:26.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  14. #14
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sadly that is what I will have to do. At the moment the site is a horrendously complicated frameset (sorry to anyone who noframes!) and will render fine in 1024x768 and above, but at 800x600 it is a little bit too short on room.

    The problem is though that I put the site in for review here, and virtually everyone said "NO!" to the splash page. I agree - I hate them, but it looks like there is no alternative!
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  15. #15
    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)
    I think this is one of the cases it is warranted. People generally have problems with splash pages and frames simply becuase they were so often misused.

    Ignore them.

    If your site is one of the ones where they ARE useful then by all means USE them!
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  16. #16
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm no lover of splash pages either, but if it's your only option in this instance then you have to go with it.

    Why the complicated frames set? Got to admit, I didn't look at the site in the reviews forum (I'll go take a quick peek now!)

    <edit>
    Hmmmn.....wouldn't open. Gave me a javascript error instead.
    Last edited by Saz249; Sep 4, 2001 at 06:40.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  17. #17
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Saz, if you're looking for it you can find it at

    www.weirdbeard.f2s.com/access

    (that should work and hopefully find your browser specs) let me know if it doesn't...

    Is there any part of window called minimise? I was thinking I could have the new window popup, then minimise the parent window? Something like window.minimize? My javascript book is useless as usual...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  18. #18
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope! I'm getting the same as before....a blank window with the javascript 'warning triangle' in the status bar.

    And I'm just looking in my javascript book now for you...
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  19. #19
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    does it tell you what the error is? i just tried at both resolutions, and it worked fine...

    ill double check the code though, just to be sure...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  20. #20
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No it doesn't tell me what the error is at all. Perhaps it's a Win ME thing! My darling husband built this system while I was away and, despite knowing that I wanted 98 on here, installed ME!!!!!
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  21. #21
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Saz -- just identified the error -- can you have another go for me (im assuming you are at 800x600?). Thanks.

    www.weirdbeard.f2s.com/access

    Thanks so much for all the help...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  22. #22
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope! Encore, la meme chose!

    And I'm not on 800x600 either - not with a 21" monitor! My res is set to 1280x1024 but I browse with a 1024x768 window. Perhaps that's the problem.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  23. #23
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't find anything in my javascript book that says you can use it to minimize a window. Sorry.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  24. #24
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats odd! This is what I am using:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    function redirectPage() {
    var page640x480 = "http://www.weirdbeard.f2s.com/access/error.html";
    var page800x600 = "http://www.weirdbeard.f2s.com/access/small.html";
    var page1024x768 = "http://www.weirdbeard.f2s.com/access/frames2/framesetlarge.html";
    var page1640x768 = "http://www.weirdbeard.f2s.com/access/frames2/framesetlarge.html";
    
    if ((screen.width == 640) && (screen.height == 480)) 
    window.location.href= page640x480;
    else if ((screen.width == 800) && (screen.height == 600)) 
    window.location.href = page800x600;
    else if ((screen.width == 1024) && (screen.height == 768)) {
    window.resizeTo(900,750);
    window.location.href= page1024x768; }
    window.resizeTo(900,750);
    else window.location.href= page1640x480;
    }
    
    </script>
    I was sure it'd direct for your res. I've added your res to the script. Try again!? Thanks...

    *EDIT* Ive just noticed the error in that script. Should be working now...!
    Last edited by weirdbeardmt; Sep 4, 2001 at 07:26.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  25. #25
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My resolution is the problem. I just switched it to 1024x768 (ouch! waaaayyyyyyy too big!) and the link worked, so it look like your code is no good for any res above 1024x768. Perhaps you could ask if other members with higher than average resolutions could try the link too.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!


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
  •