Aggiunge una immagine al puntatore del mouse.
¤ Clicca qui per visualizzare la demo... ¤
<script language="JavaScript">
var immagine = 'ani.gif';
var code = '';
if (document.all)
{
code += '<SPAN ID="pointer" STYLE="position: absolute; left: -100">';
code += '<IMG NAME="pointerImg" SRC="' + immagine + '" BORDER=0>';
code += '</SPAN>';
}
else
{
code += '<LAYER ID="pointer" POSITION="absolute" LEFT="-100">';
code += '<IMG ID="pointerImg" SRC="' + immagine + '" BORDER=0>';
code += '</LAYER>';
}
document.write(code);
if(document.layers) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = coordinate;
function coordinate(e)
{
// Calcola le coordinate del mouse
if (document.layers)
{
document.layers.pointer.left = e.pageX + 8;
document.layers.pointer.top = e.pageY + 18;
}
if (document.all)
{
pointer.style.left = event.clientX + document.body.scrollLeft + 8;
pointer.style.top = event.clientY + document.body.scrollTop + 18;
}
return true;
}
</script>
Scarica il Codice...
Stampa la pagina