Skip navigation
Tralthamidor
Currently Being Moderated

Autosize browser window

May 17, 2012 1:49 PM

Tags: #size #window

Hello I am looking for a way for a window to size itself to predeterminded dimensions when opened.

 

I have seen several examples of having a link that resizes the window it opens but that's not what I need. Only the home page needs to be a certain size, no need to put the open popup on all of the other pages linked to the home page...

 

Can this be done with a preload script in the header? I remember that GoLive had a behavior for this but that was long ago. Thanks to anyone that can point me in the right direction. -Derryl

 
Replies
  • Currently Being Moderated
    May 17, 2012 3:42 PM   in reply to Tralthamidor

    I think you're asking for a script that hijacks the user's browser settings to resize viewport to "fit" around your web page.  Not only is this an extremely rude thing to do to your site visitors, it probably won't work. 

     

    The web is much more user-centric now owing to all the different web devices and display sizes.  A better question would be "how to design my site so it adapts to fit any size window?"   Do a Google search for "Responsive web design,  "CSS Media Queries" and "Dreamweaver CS6 Fluid-Grid Layouts." 

     

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 4:17 PM   in reply to Nancy O.

    >Not only is this an extremely rude thing

     

    It used to be considered bad behavior. Now that users can elect to open new windows in tabs, it's extremely bad as it will resize all of the users other open windows.

     

    >to do to your site visitors, it probably won't work.

     

    Depending on the browser, users can configure settings to prevent resizing - otherwise it may unfortunately still work. It happened to me a few days ago on a site I visited.

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 4:34 PM   in reply to bregent

    it may unfortunately still work. It happened to me a few days ago on a site I visited.

    Double bummer! 

     

     

    N

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2012 10:29 AM   in reply to Tralthamidor
    Why do you post if you don't have a constructive answer? There was no 'rudeness' or 'hijacking' until you replied. Lighten up. -Derryl 

    Sorry you feel that way.  Actually we gave you a very constructive answer. 1) Don't use browser resize scripts.  2) Use Responsive Web Design techniques so your images don't get cut-off.  

     

    Good luck with your project,

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2012 11:12 AM   in reply to Tralthamidor

    It's for a specifc type of website with large images that get cut off because the browser uses the size of the last window that was used.

     

    Constructive answer:

    Instead of doing what you are trying to do, why not scale the images to a % value of the viewport? That way regardless of their screen size, the image is always viewable and always to scale. See this thread where I posted a solution for something similar: http://forums.adobe.com/thread/989061

     

    Non-Constructive answer:

    Everything said above is correct and the negatives to making the browser fit the image rather than the reverse, far outweigh the positives of such a method - if indeed one exists.

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2012 12:36 PM   in reply to Tralthamidor

    Unfortunately, it's not just as easy as deviating from "web standards". Modern browsers now disallow such actions and as such you will find any answer to your solution has less than desired results. It is unlikely you will get an answer that will give you consistent results across browsers. You may need to re-think about what you are trying to achieve.

     

    An example of this:

    <body onLoad="moveTo(0,0); resizeTo(800, 1200)">

     

    The code above WILL NOT WORK in Chrome, recent versions of FF and IE9 that I have tested. The reason it won't work is due to browsers actively disabling this ability. I only got it to work in IE7.

     

    If you google "resize browser window onload" you get a bunch of answers/solutions. All more or less telling you the same thing.

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2012 5:41 PM   in reply to Tralthamidor

    Please supply a link to your site so that we can stand on the same platfom to view your problem.

     

    Gramps

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points