Using JavaScript to set the browser size

B

Bill H

When I do website design I have my screen (on a PC) set for 1600 x
1200 or greater resolution so that I can have as many windows open as
I need and not have to flip between them. The issue I have is the the
IE7 window is never a consistant size because I resize it as I am
using it.

I would like to be able to open up a blank IE 7 window and have it set
to a specific size each time so that I can see the pages I am working
on in the same window size others use.

I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.

Any thoughts on how this can be done?

Bill H
 
T

Thomas 'PointedEars' Lahn

Bill said:
I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.

Any thoughts on how this can be done?

a) Upload the HTML file to a remote Web server, and access it there.

b) Set up a local Web server (I recommend Apache 2.x), and access
the HTML resource there. Having a local server for Web development
is a Good Thing anyway.

BTW, something is wrong with your mailbox:

| 220 www.ts1000.us ESMTP Sendmail 8.10.2/8.10.2; Sat, 15 Sep 2007 13:44:36
| -0400
| [...]
| 553 5.3.0 <[email protected]>... No such user here


HTH

PointedEars
 
B

Bill H

Bill said:
I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.
Any thoughts on how this can be done?

a) Upload the HTML file to a remote Web server, and access it there.

b) Set up a local Web server (I recommend Apache 2.x), and access
the HTML resource there. Having a local server for Web development
is a Good Thing anyway.

BTW, something is wrong with your mailbox:

| 220www.ts1000.usESMTP Sendmail 8.10.2/8.10.2; Sat, 15 Sep 2007 13:44:36
| -0400
| [...]
| 553 5.3.0 <[email protected]>... No such user here

HTH

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <[email protected]>

Didn't think of that (putting it on a remote server). I can put it on
one of the servers we host on (ours anyways). Thanks

As for the mailbox. I made the mistake of using that address when I
signed up in google groups. After a year of 200+ spams a day I killed
the address. Don't tell google ok? ;)

Bill H
 
T

Thomas 'PointedEars' Lahn

Bill said:
Bill said:
I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.
Any thoughts on how this can be done?
a) Upload the HTML file to a remote Web server, and access it there.
[...]

Didn't think of that (putting it on a remote server). I can put it on
one of the servers we host on (ours anyways). Thanks

You're welcome. But please trim your quotes, as recommended e.g. by the FAQ.
As for the mailbox. I made the mistake of using that address when I
signed up in google groups. After a year of 200+ spams a day I killed
the address.
http://www.interhack.net/pubs/munging-harmful/

Don't tell google ok? ;)

No promises.


PointedEars
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
When I do website design I have my screen (on a PC) set for 1600 x
1200 or greater resolution so that I can have as many windows open as
I need and not have to flip between them. The issue I have is the the
IE7 window is never a consistant size because I resize it as I am
using it.

I would like to be able to open up a blank IE 7 window and have it set
to a specific size each time so that I can see the pages I am working
on in the same window size others use.

I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.

Any thoughts on how this can be done?

I have a local Home Page which I use as a "favourites"; being a Page, I
can use it in several browsers, format it, trivially copy it to another
machine, etc.

It has
<BODY onLoad="/* window.resizeTo(640, window.screen.height*0.85) */">
in which the comment marks are recent (there's now a Button at the top
to do the resize, as OnLoad is a bit too automatic for something I now
often use). It also has quasi-links to set other favoured sizes.

In IE6 and IE7, from any other ordinary page, I can just do Home
(Button) Back to get to standard size, without prompts. I don't recall
doing anything to the IE setup to make this possible.

FireFox would not resize OnLoad, but does by button; Opera does not.
I've not needed to investigate the matter further.


Button :
<div style="text-align:center;"><input type=button value=ReSize
onClick="window.resizeTo(640, window.screen.height*0.85)"></div>

Links :
<p style="text-align:center;">
<a href="javascript:resizeTo(640,480)">640&times;480</a> |
<a href="javascript:resizeTo(800,600)">800&times;600</a> |
<a href="javascript:resizeTo(1024,768)">1024&times;768</a> |
<a href="javascript:resizeTo(1280,1024)">1280&times;1024</a></p>
 
T

Tim B

Bill H said:
When I do website design I have my screen (on a PC) set for 1600 x
1200 or greater resolution so that I can have as many windows open as
I need and not have to flip between them. The issue I have is the the
IE7 window is never a consistant size because I resize it as I am
using it.

I would like to be able to open up a blank IE 7 window and have it set
to a specific size each time so that I can see the pages I am working
on in the same window size others use.

I know you can use JavaScript to set the size of a window that you
open, but I would like to be able to set the size of the browser to a
specific size. My thought was to create a blank page on my desktop
that contained Javascript to size the window when I open it, but since
IE7 doesn't like running any local Javascript without prompting you to
do it I am not sure how I could do this.

Any thoughts on how this can be done?

Bill H

Google "bookmarklet"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top