Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set window properties on Launch

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Hi Folks,

I am trying to design a HTML page for use with an autorun CD. I only want the page to be 500x300 in size and appear in the centre of the screen. However, when it launches it takes up the whole browser window.

I know how to make it launch in the centre of the screen - that's not the problem. I need to get it to launch at the specified size. I tried using JavaScript to resize it. This resized the window but with problems. Firstly, because I have XP service pack 2, it didn't run the scripts without me clicking on the information bar and telling it to allow the scripts - not acceptable. Also, it resized it but it still contained all the menus, toolbars, status bar and scrollbars - I don't want any of this.

I also tried to use the launch window to open another page using window.open. This works - but the launch page stays open in the background. I tried to close it when the second window is launched but window.close prompts the user to check if it's ok to close the window.

Can anyone suggest a solution??

Mighty
 
Can anyone suggest a solution??
Stay with the second option... that leaves the page open in the background.

Think of this as an opportunity. You can size that page to full screen... set the background colour of the page... and even put up some credits and have links through to a web site (requiring internet access) and to version information. This could also be the place you could "promote" a corporation's logo (or your own).

Sure I'll probably just close the page down. But I'll read it first... and as long as it's done well... it's not going to be the end of the world.

Just a fresh opinion I had [smile]
Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
An alternative, albeit not one I would opt for (I personaly would just have the regular window), is to move the opening screen out of the screen area. Since you can move windows around, you could simply move it off screen. It would stay on the taskbar but that is it.

One thing is confusing to me. Your page is centered vertically and horizontaly on the page and still you want the browser centered and resized... Are you making the page for the centered community?
 
Thanks guys.

Maybe I'll just use a full-size window.

Mighty
 
AFAIK you cannot move a window completely off the screen (or resize it to less than a certain size). This is a security thing to keep unscrupulous people from opening hidden windows while you're browsing.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy, you are right... you can't move the window completely off the screen. I think there may have once been a time you could... but certainly no longer.

You will also find restrictions on how small you can set the browser window (using javascript)... not that it's an issue for this instance.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top