We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

Feb30th1712 on 01/14/08


Tagged

resize window bookmarklet viewport


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

jonhenshaw
korzhik


640x480


Published in: JavaScript 


  1. /*
  2. javascript:moveTo(0,0);var width,height;sizeToContent();width=outerWidth;if(width>screen.availWidth){width=screen.availWidth;}height=screen.availHeight;resizeTo(width,height);
  3. */
  4. var width, height;
  5. sizeToContent();
  6. width = outerWidth;
  7. if (width > screen.availWidth)
  8. { width = screen.availWidth; }
  9. height = outerHeight;
  10. if (height > screen.availHeight)
  11. { height = screen.availHeight; }
  12. resizeTo(width, height);

Report this snippet 

You need to login to post a comment.