1. Computing & Technology

Bubbles

2. Obtain the Script

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Introduction Add to Your Page

Related Terms

DHTML DOM

To make bubbles on your web page you first need to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called bubbles.js.

The only line in the Javascript that you may want to alter is the one that sets the number of bubbles that are displayed.

bubbles image The other thing that you will need to copy is the bubble image. To do this in most browsers simply right click on the double sized static bubble image at the start of this paragraph and select save picture as or save image (depending on which browser you are using). You need to save the image as bubble.gif. If you are not puting the image in the same folder as the web page then you will need to update the bubbles variable to reflect the correct location of the image in order for the script to work. If you don't want to use the image supplied, you are welcome to use your own image and if you want more than one image just add more images to the bubbles array separating the filenames with commas.

Now all that remains is to add the script to your page.

Sample Page | Obtain the Script | Add to Your Page

©2012 About.com. All rights reserved.

A part of The New York Times Company.