Follow the MouseAnother Sample |
|
Join the DiscussionMore of this FeatureThis page demonstrates a much more complex example of how the "follow the mouse" script can be used. In this example the Analog clock script has also been added to the page with the div for the clock being placed inside of the div that will follow the mouse. As you can see the fully functional clock now follows the mouse cursor around the screen. This effect was achieved by placing the following code in the head of the page:
<script type="text/javascript"
src="follow.js"></script>
<script type="text/javascript" src="clockp.js"></script> <script type="text/javascript" src="clockh.js"></script> and the following in the body of the page:
<div id="mydiv"><div
id="clock_a"></div></div>
As you can see the two scripts combine together quite easily to produce a quite sophisticated effect. The only clash between the two scripts is that the clock script will cause the clock to become visible at whatever position within the page that you define the div when the page finishes loading rather than the clock remaining hidden until the mouse moves. |

