1. Computing & Technology

Creating and Modifying Browser Windows and Frames

Popup windows, thumbnail image popups, resizing browser windows, scrolling the window content, frames and more. Take control of your visitor's browser with these scripts.
  1. Frames (6)
  2. Popup Windows (10)

Free Weekly Popup Window Class

Learn how to create popup windows. This free course over four weeks will take you step by step through the process of creating, modifying, and closing popup windows created with Javascript. In the final week we will look at an actual application of what you have learnt to create thumbnail image popups.

Is This a Popup Window?

It isn't actually possible to tell of a request to open a new window actually opens a separate window or just creates a new tab. That doesn't matter though because they are both treated the same way. We do need to be able to distinguish whether those from a page opened in the original browser window though and this page demonstrates a simple way to do so.

Modal Windows

There is no standard way of making a browser window modal and many browsers don't support it at all. Here is how to make the window modal in those that do provide a way.

Window Close

Javascript can close windows (sometimes). Here's how to close the current window or another window that your page opened once it is no longer needed.

Popup Blocked

With popup blockers being so common today and with each behaving slightly differently you can't guarantee that any method of coding your popup will necessarily result in that popup appearing. By adding a small piece of Javascript after the window.open call we can test if the browser allowed the window to popup and therefore take a different action in those instances where it was not permitted.

Popups and Blockers

How to code your popup window to give it the best chance of avoiding the popup blockers.

Calendar Popup

Add a popup window containing a calendar to your web page with this script.

Frame Breakout

Whether you like or dislike web pages that use frames, you probably don't like the idea of someone else placing your pages within a frame on their site to make it look as if it is theirs. This simple Javascript will break your page out of their frames.

Javascript Includes

External Javascripts can be used to generate common code that will appear on all of the pages of your site. If you create some of your site navigation this way then you can easily change it on all the pages all at once when you need to.

©2012 About.com. All rights reserved.

A part of The New York Times Company.