Elastic band bullets

If you want to see a chain of bullets connected by an invisible elastic band do this:
  1. Register and download the files
  2. Include 'elasticbullets.js' from the head of your page
  3. Define parameters or accept the defaults
  4. Insert the image and start animation
This script requires Internet Explorer 5+ or Nescape Navigator 6+! In other browsers it does nothing.

1. Register and download the files

Before downloading the program you are requested to register yourself. There is no registration fee. If you register, you are allowed to use the program as a free software, and we will inform you about future upgrades.

You can download the files either in zip or in tgz format.

2. Include elasticbullets.js from the head of your page

Insert the following line into the head of your page:
  <script src="elasticbullets.js"></script>

3. Define parameters

You can accept the defaults or assign new values to these variables:

  ebimg="bullet.gif"
The image that follows the cursor.

  ebHTML=null
Use this instead of ebimg if you want something else to follow the cursor.

  ebwidth=11; ebheight=11;
Size of the image or the HTML object.

  ebnumdots=11
Number of dots.

  ebseglength=20
Length of the elastic band between two dots.

  ebspringk=10
Spring force constant.

  ebmass=1
Mass of a bullet.

  ebgravity=50
Gravity constant.

  ebresistance=10
Resistance loss constant.

  ebbounce=0.75
Bounce factor.

  ebzindex=5
Define z order position of image. Drag the example image over this section to see it working. This section is on a relative positioned layer with z-index of 9.

Set parameters and press Update!
Parameter Value
ebnumdots=
ebimg=
ebHTML=
ebwidth=
ebheight=
ebseglength=
ebspringk=
ebmass=
ebgravity=
ebresistance=
ebbounce=
ebzindex=
   
   
>>> <<<

4. Inser the image and start animation

Call ebwrite() from anywhere in the body of the document.
  <script>ebwrite()</script>;

Or call ebwrite(x, y) to specify inital position.
  <script>ebwrite(100,100)</script>;