Elastic band bullets

If you want to see a chain of bullets connected by an invisible elastic band do this:
  1. Download the files
  2. Include "elasticbullets.js" from the head of your page
  3. Define parameters or accept the defaults
This script works with Internet Explorer 5+, Nescape Navigator 6+, or any version of Firefox, Opera, Chrome or Safari.

1. Download the files

Download the files in zip format, and copy the contents to the same folder where your web page is.

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

Insert the following line into the head of your page:

<script type="text/javascript" src="elasticbullets.js"></script>

3. Define parameters

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

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

The image that follows the cursor.

ebb.img= null;

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

ebb.html= null;

Background color. Transparent is 'rgba(0,0,0,0)'.

ebb.background= 'blue';

Size of the image or the html object.

ebb.width= 10; ebb.height= 10; ebb.radius= 5;

Number of dots.

ebb.numdots= 10;

Length of the elastic band between two dots.

ebb.seglength= 20;

Spring force constant.

ebb.springk= 10;

Mass of a bullet.

ebb.mass= 1;

Gravity constant.

ebb.gravity= 50

Resistance loss constant.

ebb.resistance= 10

Bounce factor.

ebb.bounce= 0.75

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. See how the mouse trail images can go behind the text.

ebb.zindex= 5

More examples