Jan 29, '04 10:15:00AM • Contributed by: CkB_Cowboy
javascript:function rsz(s,i,w,h,m){if(i.screenX<0||i.outerWidth>
w||i.outerHeight>h){s.moveTo(0,0);s.resizeTo(w,h)};if(m){s.moveTo(m==1?0:
screen.availWidth-w,0);};s.resizeTo(w,h);};rsz(self,window,
WIDTH,HEIGHT,H_ALIGN);
that has three user-modifiable parameters:WIDTH: window width in pixels
HEIGHT: window height in pixels
H_ALIGN: align to one side of the screen (1 = left align, 2 = right align)
Just copy the Bookmarklet text above and change those three parameters to what you want. Special javascript values can be used as well, such as screen.availWidth for the full width of the screen and screen.availHeight for the full height of the screen.
Examples:
800,600,1: A left-aligned 800x600 window. - Clickable: 800x600
javascript:function rsz(s,i,w,h,m){if(i.screenX<0||i.outerWidth>
w||i.outerHeight>h){s.moveTo(0,0);s.resizeTo(w,h)};if(m){s.moveTo(m==
1?0:screen.availWidth-w,0);};s.resizeTo(w,h);};rsz(self,window,800,600,1);
800,screen.availHeight,2: A right-aligned 800xFull-Height window - Clickable:
800xFull
javascript:function rsz(s,i,w,h,m){if(i.screenX<0||i.outerWidth>
w||i.outerHeight>h){s.moveTo(0,0);s.resizeTo(w,h)};if(m){s.moveTo(m==1?0:
screen.availWidth-w,0);};s.resizeTo(w,h);};rsz(self,window,800,
screen.availHeight,2);
(Note: ignore, but don't change, the first two arguments in the rsz function call). Also, I use this simple bookmarklet to make my browser full-screen - Clickable:
Full Screen
javascript:self.moveTo(0,0);self.resizeTo(screen.availWidth,
screen.availHeight);
Many people don't realize this (even though it was mentioned in a previous hint), but when you create bookmarklets like these and put them in the "Bookmarks Bar" that they are automatically assigned hotkeys, from left to right, Command-1, Command-2, etc.. and these hotkeys work regardless of the visibility of the Bookmarks bar.I have my most commonly used Bookmarklets in there, and since I'm on a 12" PowerBook running an IM and IRC client, I am constantly moving the browser window around to make up for the lack of screen real-estate. With simple hotkeys I can change from Full-Screen to 800xFull R, to 800x600 R, etc. very quickly!
Here's a clickable list of some common sizes that you can drag into your Bookmarks Bar directly, if you so desire:
Left Aligned: 800x600 - 800xFull - 1024x768 - 1024xFull
Right Aligned: 800x600 - 800xFull - 1024x768 - 1024xFull
I have a few more cool bookmarklets in my arsenal, but I figured I'd share these first!
