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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Window Size Using HTML

Status
Not open for further replies.

robert89

Technical User
Nov 19, 2003
125
CA
Does anyone know a way of controlling the size of a window opened as a result of clicking a hyperlink. I want to be able to do this using html, and not other programming languages.

Thought of having the results of the link appear in a blank file where "onload" has been used to set the initial size of the window. Is this type of link possible in html?

Any help would be greatly appreciated.
 
Using only pure HTML -no! You have to do that with javascript. Look at this FAQ faq216-329

Good Luck §;O)
 
Adding to the FAQ, you can also change the current window size by:

Code:
<script language=&quot;javascript&quot;>
var newWinWidth = 400;
var newWinHeight = 400;
window.resizeTo(newWinWidth, newWinHeight);
</script>

To always maximized window
Code:
window.resizeTo(screen.width, screen.height);
 
Hi Byam,

Not what I had in mind, but does open a possiblity -- I think.

Is there anyway of using the javascript you have provided and changing it from resizing current window to whatever new window is opened by clicking on a a link in the current page?

I like the script because it's short and neat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top