Categories
Other Sections
Bookmark to del.icio.us
IE5+ Opr7+

Roaming Cursor

Author: Kurt Grigg | Homepage

Notes: Modified by Dynamic Drive to display only one type of cursor

Description: Display a second, "roaming" cursor on your page with this fun animation script. An image resembling the mouse cursor wonders around the screen, rendering an amusing spectacle. The image is customizable, so a cursor is certainly not the only thing you can instruct to roam. DHTML programmers, examine the source to learn about the coding techniques involved in creating a random path for the moving image.

Demo: Observe closely the page...


Directions Developer's View

Step 1: Insert the below inside the <BODY> section of the page:

Select All

Step 2: Choose one of the following four images to display as the roaming cursor, and save the image by right clicking it, and selecting "Save As".

cursor.gif (132 bytes) cursor2.gif (155 bytes) cursor3.gif (151 bytes) cursor4.gif (155 bytes)

The third cursor may not be suitable for all sites!

Note: Be sure to configure the top variable inside code of Step 1 above to correctly reference the image used.

Technical Note

This script accesses the BODY onload event (window.onload). If you have another script on your page that does the same, one of them will not run. Click here for information on getting both scripts to work simultaneously.