Javascript ist für die seltsamsten Dinge gut. Sogar der Mauszeiger lässt sich manipulieren. Der Trick ist eigentlich simpel, die verschiedenen Cursor-Varianten wie nw-resize,w-resize und so weiter wechseln sich ständig ab, so dass der Eindruck eines sich bewegenden Objekts entsteht.
Und der Quellcode für eine komplette Seite:
<html>
<head><title>Drehcursor</title>
<script language="Javascript">
var count=1;
function maus()
{
if(count==8)
{
document.all.cursor.style.cursor
= 'nw-resize';
count=1;
}
if(count==7)
{
document.all.cursor.style.cursor
= 'w-resize';
count++;
}
if(count==6)
{
document.all.cursor.style.cursor
= 'sw-resize';
count++;
}
if(count==5)
{
document.all.cursor.style.cursor
= 's-resize';
count++;
}
if(count==4)
{
document.all.cursor.style.cursor
= 'se-resize';
count++;
}
if(count==3)
{
document.all.cursor.style.cursor
= 'e-resize';
count++;
}
if(count==2)
{
document.all.cursor.style.cursor
= 'ne-resize';
count++;
}
if(count==1)
{
document.all.cursor.style.cursor
= 'n-resize';
count++;
}
}
window.setInterval("maus()",100);
</script>
</head>
<body id="cursor">
</body>
</html>


Letzte Kommentare