Exploding fireworks

Navigation

Skip navigation.

Site search

Site navigation

Details and download

The script

This fires a rocket from the bottom of the screen and explodes it near the top. The falling parts glitter. Once they reach the bottom, they are recycled back into a new rocket. Browser window settings are read just before each rocket is fired, allowing scrolling and resizing to be taken into account. Sine and cosine functions are used along with pseudo gravity to create the explosion.

The falling pieces change colour randomly for a glittering effect. The way this is done is to use the clip style to make the pieces small and colour only their background. Unlike foreground colour, layers browsers (like the old Netscape 4) can change background colour after the document has loaded.

To download the script(s), see the script license, and check details like browser compatibility, use the links on the navigation panel at the top of this page.

Demonstration

The demo page is held here inside an inline frame:

This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.