Dynamic Drive DHTML code library!
Dynamicdrive.com

Please visit our sponsor above /\

.
spacer.gif (807 bytes)
spacer.gif (807 bytes)
Featured Script
Static Menu 3
Add an elegant, visible from the start static menu to your site with this script!
.
Site Info
Search DD
Recommend DD
Awards
DD Award
Press Releases
Ad Media Kit
Contact
.
Site Partners
JavaScript
Free clipart

.
Link to DD
Please use the following image to link to Dynamic Drive:

dynamiclogo2.gif

More images here.
.

spacer.gif (807 bytes)

Home Small4.gif (1046 bytes) Image Effects Small4.gif (1046 bytes) Here

Bouncing image script All

Credits:
Name: Hass
Homepage: Homepage

Description: Through absolute positioning, along with clever math calculations, Hass (a Dynamicdrive.com surfer) has created this great bouncing image script. It charges aimlessly through the page, hitting and refracting off the edges of your browser window. It does so even if the user scrolls the page (unlike a fault seen in many similar scripts out there). Spectacular...

Demo: Hard to miss...


Directions: Developer's View

Step 1: Download the following image file and upload it into your webpage directory (either by clicking it, or clicking it with the shift key depressed for NS users): Or, ignore this step if you wish to use your own image.

superball.gif (2240 bytes)

Step 2: Add the following into the <head> section of your page:


Step 3: Last by not least, copy the following into the <body> section of your page, outside any other tags. This contains the actual HTML codes used to display the bouncing image:


Bounce away!

Configuring the script

The image to be bounced can be changed to your own. To do so, you'll need to edit not only the image src attribute inside Step 3, but also, three variables located at the top of the code in Step 2. One of the three variables also controls the speed in which the image bounces around.

Recommend Us!
-If you like Dynamic Drive, please recommend us to a friend...

Legend
All- Script works with Netscape 4+ AND Internet Explorer 4+
NS- Indicates script works with Netscape 4 and above
IE- Indicates script works with Internet Explorer 4 and above
IE5- Indicates script works with Internet Explorer 5 and above

Subscribe to our newsletter!
Want to be right here when new scripts are added? Subscribe to our FREE newsletter then!

Copyright © 1998-2000 Dynamic Drive. Please read Terms Of Use here before using any of the scripts.