Chapter 13: Making Your Pages Dynamic

Return to Chapter 13

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Moving an Object in the Document

See it run: Moving an Object in the Document

Script 13.10

This HTML for the object moving example uses IDs to tag the elements we want to manipulate.

Script 13.11

This CSS sets the initial positions of each object on the page.

Script 13.12

This JavaScript moves the object on the page.

Images:

full_moon.jpg
black_dot.gif