Download the files in zip format, and copy the contents to the same folder where your web page is.
Insert the following line into the head of your page:
<script src="elasticbullets.js"> </script>
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 'transparent'.
ebb.background= 'blue';
The size of the image, or the size of the html object in pixels.
ebb.width= 10; ebb.height= 10; ebb.radius= 5;
The number of dots.
ebb.numdots= 10;
The length of the elastic band between two dots.
ebb.seglength= 20;
Spring force constant.
ebb.springk= 10;
The 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 go behind the text.
ebb.zindex= 5;