SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controlling Window Size (Not a Pop Up)

    Is it possible to use JavaScript to place code on a page that will cause that page to open at a specific size? This is NOT a pop up. I have no control over the link that is sending someone to this page. What I want to do is to place code on the page so that when it opens from the outside link it opens at a specific size. I've done a lot of searching but all I can seem to find is code to create a pop up window at a certain size. Any help or guidance would be greatly appreciated. Thanks!

  2. #2
    SitePoint Zealot rhlowe's Avatar
    Join Date
    Sep 2006
    Location
    San Diego
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The outerHeight and outerWidth window properties are read only, so says the Mozilla Developer center, but when I type "window.outerHeight = 500" into my firebug console, the scree does resize. However, I have to beg the question why would you want to basically hijack a user's browser height when they are likely viewing it at the size they want?
    San Diego Freelance Web Development Contractor
    Great Taste, no Filler. Now with no Trans Fat!

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Control the size of your content, rather than the browser window. Perhaps you could put your content in a wrapping div that is sized as you wish.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's the deal: my client wants to have a popup signup form that is 500px by 500px. When the viewer enters their information it is entered in a 3rd parties database and that 3rd party then sends them to a "landing" page that we specify. However, the page they will be directed to after they enter their information is bigger than 500px by 500px. As it stands right now when the form goes to the third party and then back the "landing" page opens in the same window the form was it which is 500x500. So I'm hoping to put code on that landing page to override the 500x500 of the form pop up window. Make sense?

  5. #5
    SitePoint Zealot rhlowe's Avatar
    Join Date
    Sep 2006
    Location
    San Diego
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, that makes sense. So what I would try to do is redirect to a page that opens a new window (the landing page) and then closes itself. Now, there is a certain amount of trouble in making a page close itself with JavaScript, but I have seen an article someplace that showed how to make it work, but I didn't save it, so I can't help you there.
    San Diego Freelance Web Development Contractor
    Great Taste, no Filler. Now with no Trans Fat!

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your client creates the 500x500 popup window (which submits to another site then back to you), have it submit in a new window which is bigger, and then close the popup. Any good?

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestions and feedback. I've convinced them to do this a bit differently so I think we can avoid this problem afterall.


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
  •