Stefan Bach: lässt sich der Mauszeiger zu einer best. Zeit ändern?

Beitrag lesen

Hallo Holger!

Eigentlich stimme ich Klaus zwar zu, wenn er meint, dass es nicht möglich ist. Aber wenn du es trotzdem machen willst, dann so:

#!/usr/bin/perl

$| = 1;

print "Content-type: text/html\n\n";

print <<HTML;
<html>
 <head>
  <script language="JavaScript">
   function cursor (cursor_style) {
    node = document.getElementsByTagName("html")[0];
    node.style.cursor = cursor_style;
    setNodes (node, cursor_style);
   }

function setNodes (node, cursor_style) {
    if (node.childNodes.length > 0) {
     for (var i = 0; i < node.childNodes.length; i++) {
      if (node.childNodes[i].nodeType == 1) node.childNodes[i].style.cursor = cursor_style;
      setNodes (node.childNodes[i], cursor_style);
     }
    }
    else {
     if (node.nodeType == 1) node.style.cursor = cursor_style;
     if (node.nextSibling != null) {
      setNodes (node.nextSibling, cursor_style);
     }
    }
   }
  </script>
 </head>

<body>
  <p>Seite ist am laden, Cursor normal, bitte warten...</p>
  <script language="JavaScript">cursor('default');</script>
HTML

sleep 5;

print <<HTML;
  <p>Cursor auf Wartestellung...</p>
  <script language="JavaScript">cursor('wait');</script>
HTML

sleep 5;

print <<HTML;
  <p>Seite geladen. Cursor normal.</p>
  <script language="JavaScript">cursor('auto');</script>
 </body>
</html>
HTML

Zu testen unter http://62.75.136.98/cgi-bin/realteck/cursor.pl.

Gruß,
      Stefan

P.S.: Danke, wegen dir hab ich mein Abendessen verschoben :(
      Das hat man davon, wenn man etwas nur mal kurz fertig programmieren will *g*