Return to the Javascript Playground |
Download This Page |
The Animation loads eyes and/or ears randomly until you press Stop. You can change the head and/or nose while this is going.
The heads and other parts were obtained from public-domain clip art. Each part was cut out and saved as a separate gif file using the Macintosh application GraphicConverter 2.8.
The head in the center is made from nested tables set up without borders and with cell sizes matching the images they contain (no mean feat). Note that the HTML code for the table definitions has no carriage returns or line feeds which would cause spaces to appear between the images. Each of the images is named so that they can be referred to symbolically by the JavaScript code in the right frame.
The right frame pre-loads all the required image files. The eyes, noses and mouths in the right frame use client-side image maps to call up JavaScript subroutines which replace the appropriate images in the center frame. The link tags for the various heads call up JavaScript functions to replace 3 or 4 images simultaneously in the center frame.
The code for the page is extensively annotated. Please help yourself, but if you use it, we would like you to give WebSorcerer credit somehow and let us know where your site is so that we can appreciate your work.
©L. A. Shadoff, 1998