Resizing Pages

When you’re working on a site, it’s useful to be able to see how a page looks with a smaller display than the one you’re using. This bookmarklet, Script 17.15, resets your browser window to 640x480.

To resize your page:

  • resizeTo(640,480); moveTo(0,0);

    The first command, resizeTo(), changes the dimensions of your browser window. The next, moveTo(), tells the browser where to put the top-left corner (Figure 17.30).

Figure 17.30. We can see at a glance that the small screen version of this site doesn’t show much of the content.

✓ Tips

  • By itself, this bookmarklet is only moderately useful. Where it shines is when you create a folder ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.