Simple Mouse Trail using VB Script
<script language=VBScript> Sub document_onMouseMove(eventcapture) my_stuff.style.left=eventcapture.screenX-50 my_stuff.style.top=eventcapture.screenY-100 End sub </script> Whatever you want, even images: Following the cursor is really very easy in VB script. Simply set up a span tag with an id of, say 'my_stuff' then use the built in IE subroutine
document_onMouseMove
to set the absolute position of the span. You can adjust the amount to get it just where you want in relation to the cursor. What could be easier?
As an adjunct to this, if you move the cursor around on this page you will see that the trailing text attempts to adjust itself to fit - try pushing it up against the right margin for example.
One final word of warning, if your page scrolls down (as this one does) you will lose the mouse trail. To keep it we would need to take account of the
document.body.scrollTop
position - but that's for another time.
For now, enjoy the simplicity of this little script.
|