Move and resize browser window…
To move a browser window to a specific location on the users screen:
window.moveTo(x,y);
replacing “x,y” with pixel coordinates.
More info here, where they also have the below which will give you the users screen width, height:
screen.width
screen.height
Also, to resize the browser window:
window.resize(width,height)
Now, before you go all crazy on me - I’m not suggesting people do this for sport on their blogs. Messing around with people’s browser’s sizes, position, etc. will be annoying and NOT very usable. The reason why I needed the code above was to create a “minimize my browser” type effect with a bookmarklet for my mac (aka. “hide! the boss is coming”). The end result is this: mini-me
February 27th, 2003 at 10:36 am
That is really nifty… I tend to have so many windows open on this damn PC that I can easily click back to Google or something harmless whenever someone comes near. I keep my desk facing everyone and everything so I’m generally prepared, but there’s always one time when I’m not… this is a nice trick to use!
February 27th, 2003 at 11:45 am
Oh. my. gosh. That’s so great! I feel so evil….
February 27th, 2003 at 5:17 pm
Not cool. Maybe have a warning for people using PCs to NOT click that window there?! I wasn’t able to maximize my window again! I had to restart and even then I had to do a full window to comment here. I don’t know why it’s doing this but I hope I can fix it. :/
February 27th, 2003 at 5:26 pm
Anabella - I’m not sure why you had a problem. I’m on a pc right now and all it does is make the window smaller and moves it just above the taskbar… all had to do to “fix” it was pull the window up, and resize the browser again… Did it not let you do that??
Can you email me what your OS/browser ver set up is?
February 27th, 2003 at 8:37 pm
I clicked the ‘mini-me’ link, and this is what happened for me:
1. The window turned into a small window in the bottom left-hand corner.
2. I clicked the “restore” button.
3. I clicked the “maximize” button. And the window I got only had the title bar and part of the toolbar visible, on the bottom of my screen, just above the taskbar.
This under Windows XP with Internet Explorer 6. It works just fine in Phoenix (Mozilla-based browser), in that the maximize button is available in place of the ‘restore’ button.
February 27th, 2003 at 10:11 pm
Ok, guys, please read this: To restore your browser back to normal, simply click on the title bar, drag the window up. Then click on the edges of the browser window and drag the sides out… that’s it.
This script isn’t doing anything you can’t actually do on your own…
February 27th, 2003 at 10:40 pm
Ok, NOW I see what the difference is. I never have my browser maximized, and *that* is what causes the problem.
To correct the problem - while your browser is “maximized” (whever it is, even if it’s pushed down at the task bar) go to “file->Open” and copy and paste the below instead of a
February 27th, 2003 at 11:49 pm
Thanks
I restarted my computer, tried maximizing it again. Thing is first time around I couldn’t drag the window anywhere therefore I couldn’t resize it. Err. But it finally maximized. Am using Windows XP and IE6, too.
February 28th, 2003 at 12:43 pm
scriptygoddess: “The reason why I needed the code above was to create a
“minimize my browser” type effect with a bookmarklet for my mac (aka.”
March 1st, 2003 at 10:14 am
Aha! Thank you, Jennifer. I’ve had the same thing happen with the Cpanel 6 file manager, it’s great to have the fix.
March 1st, 2003 at 11:28 pm
WHEW good thing you posted that fix… having an invisible browser window is NOT cool! I’m on Win 2000 with IE 6.0.
March 5th, 2003 at 7:12 am
mine is IE6 on win98se, and thanks very much for the fix
March 5th, 2003 at 10:56 am
Needed an easy way/place to post this:
Just for Geekgrrl
(NOTE: If you have your browser maximized - I’m not sure what that will do to your screen so DON’T CLICK ON IT! - or if you do, be ready with the fix further up in the comments…)
March 5th, 2003 at 1:34 pm
Sweet! You rock.
Thank you.
April 30th, 2003 at 5:34 pm
Thank you sooo much, some @#&* site resized my browser window so that it was huge (Mac OS X) and I could not get to the handle in the corner to scale it down… what a relief.
July 15th, 2003 at 11:17 pm
Oh, wow. Thank you. I just googled to find this. I had actually done something unrelated that permanently resized my maximized IE6. The javascript void you posted fixed it right up. Since I know you’re curious, I was checking out some websites deemed top quality, and visited http://www.baglionihotels.com. It’s really nice (and the hotels oh, so dreamy), but it did create the same problem some of the posters above had.
February 9th, 2004 at 10:04 am
when resizing the window is it possible to show without all the gadgets: menu bar, scroll bar , etc.
im using the code to load a page with an image 400×400
thnx
February 9th, 2004 at 10:13 am
to do that - I think you have to launch a new window - and when you do that, you can specify which gadgets you want displayed (or not displayed)
March 21st, 2004 at 11:28 pm
had the same problem with 98se and ie6, but i was able to unstick it - after it turned into a shortcut… oops
but the reason i write is to say thanks, cuz this site just pops up when i google sometimes, and its always spot on. and CUTE!
March 16th, 2005 at 7:48 pm
Hi -
I need something related, but I am new to CSS and can’t seem to find it.
I need the CSS for a window to open to a specified size, and be on top.
It is for my newsletter link, so I want them to be able to see it obviously!
As timu asked, I would like it to be plain window. How do you specify which gadgets you don’t want displayed?
Also, is there a way to re-direct the original window to the landing page of the newsletter window? That part may not be CSS, but it’s related, so I thought I’d ask…
BTW - your cool little tool worked just fine on my PC in FireFox running XP!
March 17th, 2005 at 12:41 pm
What you’re looking for isn’t CSS - it’s javascript. (actually the code above is javascript too) Try searching for “javascript open new window” in google - I’m sure there’s got to be lots of tutorials and scripts…
March 17th, 2005 at 3:51 pm
Oh, thanks.
I thought I was supposed to do as much as I could in CSS because some people turn off their javascript, which would defeat the purpose.
I figured that the size was part of the page layout, so there would be a CSS way. I thought CSS could do ANYTHING!