# Resize browser window!

**URL:** <https://forum.kirupa.com/t/resize-browser-window/7666>\
**Category:** Uncategorized\
**Created:** [November 5, 2002, 2:55pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666 "2002-11-05T14:55:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jerry](https://forum.kirupa.com/u/jerry)\
**Post date:** [November 5, 2002, 2:55pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/1 "2002-11-05T14:55:18Z")

</div>

Hey!

I’m looking for a script that can resize the browser window! For example: I got a script that opens a new window, in the new window I would like to have a few buttons, that when you press the window would be resized! …Like it fades to another size!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 11, 2002, 8:50am UTC](https://forum.kirupa.com/t/resize-browser-window/7666/2 "2002-11-11T08:50:40Z")

</div>

Button\>JavaScript\>Resize window, eh? is this your request? Well, take a look at the following:

```php
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function resize() {
window.resizeTo(740, 580);  
}
</SCRIPT>
</HEAD>
<BODY>
<input type=button onclick=resize()>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 2:57pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/3 "2002-12-19T14:57:15Z")

</div>

that will make the window resize gradually?

=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 3:35pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/4 "2002-12-19T15:35:08Z")

</div>

Try the following:

Insert this into your HTML:

```php
<SCRIPT LANGUAGE="JavaScript">
function resize(x, y) {
window.resizeTo(x, y);  
}
</SCRIPT>

```

And the actionscript involved is:

[\*PHP]x = 500;  
y = 500;  
getURL(“javascript:resizeTo(”+x+","+y+");");

```auto

h88 8]
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 3:45pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/5 "2002-12-19T15:45:47Z")

</div>

> \*Originally posted by Guig0 \*  
> \*\*that will make the window resize gradually? \*\*

Nope.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 3:50pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/6 "2002-12-19T15:50:20Z")

</div>

that didnt work:(

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 4:00pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/7 "2002-12-19T16:00:54Z")

</div>

hey… i havent dealt with javascript (yet:P)… but if loops work the samy way the do on any other languages, you might be able to make a loop that resizes the window gradually using this code…

> \*Originally posted by Abraxxas \*  
> \*\*

```php
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function resize() {
window.resizeTo(740, 580);  
}
</SCRIPT>

```

\*\*

if theres a function that gets the current window size, then you can subtract the new size off the current size and divide that into lets say 10 and store it into a variable, and loop the resizeTo() function 10 times, where it subtracts the number in that variable…  
again, this is just an assumption… im into javascript really=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 19, 2002, 4:02pm UTC](https://forum.kirupa.com/t/resize-browser-window/7666/8 "2002-12-19T16:02:03Z")

</div>

Guig0:

remove the space from the java script word, i dunno why the forum add’s this space. :-\
