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
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.
>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.
Thanks, but I wasn't looking for unsolicited lessons on internet etiquette. Just came here hoping to get help with an issue that I couldn't solve. 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.
Why do you post if you don't have a constructive answer? There was no 'rudeness' or 'hijacking' until you replied. Lighten up. -Derryl
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.
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.
Hey Rik, thanks. Scaling the images in the viewport normally would be the way to go with this. Unfortunately my client has a very specific need. The photos need to be presented at exactly 800 x1200 with other things presented in a certain manner on the page for a type of auction to a few invited guests. Sometimes you need to deviate from web standards.
I do appreciate the info though. Thanks.
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.
North America
Europe, Middle East and Africa
Asia Pacific