Newsgroup: it.comp.lang.javascript
Titolo: Caricare un cursor esterno

Riporto sotto uno script che non avevo mai incontrato prima. Molto
carino, anche se un po' pesantuccio.
A proposito di puntatori, chi mi consiglia un semplice Javascript che
carichi un cursor da utilizzare nelle pagine?
Grazie, Ghizza.
<script LANGUAGE="Javascript1.1">
<!-- Un curseur etoile
  // Librement adapte d'un script vu sur 
http://www.philips.com
  // Copyright Frank Milard - 
http://www.asaisir.com/a-la-page
  // Vous pouvez utiliser ou modifier ce script librement
  // sous reserve de laisser le copyright visible
var nameSP1 = "IMAGE.gif";
var heightSP1 = 10;
var widthSP1 = 10;
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
VERSION4 = (NS4|IE4) ? 1 : 0;
var styleSP1 = (NS4) ? "" : ".style";
var objSP1 = new Array();
var numObjSP1 = 6
var ptrSP1 = 0;
function defObjSP1(ID) {
    if (NS4) {
        this.layer = new Layer (0);
        this.layer.visibility = "hidden";
        this.layer.document.write('<img src=\"'+nameSP1+'\"
height=\"'+heightSP1+'\" width=\"'+widthSP1+'\" border=\"0\">');
        this.layer.document.close();
    } else {
        eval ('this.layer = document.all.SP1'+ID);
    }
    this.old = 6;
}
function testVisibilitySP1() {
    for(var x=0; x < numObjSP1; x++) {
        with (objSP1[x]) {
            if (old <numObjSP1) {
                if (++old == numObjSP1) eval('layer' +  styleSP1 +
'.visibility = "hidden"');
            }
        }
    }
}
function mouseEventSP1(e) {
    ptrSP1 = (++ptrSP1 < numObjSP1) ? ptrSP1 : 0;
    objSP1[ptrSP1].old = 0;
    if (NS4) {
        objSP1[ptrSP1].layer.visibility = "visible";
        objSP1[ptrSP1].layer.left = e.pageX ;
        objSP1[ptrSP1].layer.top = e.pageY + 5;
    } else {
        objSP1[ptrSP1].layer.style.visibility = "visible";
        objSP1[ptrSP1].layer.style.pixelLeft = event.clientX +
document.body.scrollLeft ;
        objSP1[ptrSP1].layer.style.pixelTop = event.clientY +
document.body.scrollTop + 5;
    }
}
function initSP1() {
    if (VERSION4) {
        for(var x=0; x<numObjSP1; x++) objSP1[x] = new defObjSP1(x) ;
        if (NS4) document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = mouseEventSP1;
        setInterval("testVisibilitySP1();",40);
    }
}
if (VERSION4 && ! NS4) {
    for (var x=0; x<numObjSP1; x++) {
        document.write('<div id="SP1'+x+'" style="position: absolute;
visibility: hidden;">');
        document.write('<img src="'+nameSP1+'" height="'+heightSP1+'"
width="'+widthSP1+'" border="0"></div>');
        document.write('</div>');
    }
}
if (window.onload) {
    if (window.RegExp) {
        var regstr = '^[^\\{]*\\{((.|\\t|\\n|\\r)*)}[^\\}]*$';
        window.onload.toString().match(regstr);
        window.onload = new Function (RegExp.$1+"; initSP1 ();");
    }
}
else window.onload = initSP1;
// -->
</script>
--
ghi...@tiscalinet.it
http://go.to/ghizza
  |  
http://also.as/ghizza
"Strangers passing in the street
By chance two separate glances meet
And I am you and what I see is me"

Vedi le FAQ (
http://jslabs.webhostme.com
) "puntatori mouse"
Ciao
Giuseppe Di Natale
gdin...@camomillaitalia.it
-------------------------------------------
JS Labs - FAQ di it.comp.lang.javascript
http://jslabs.webhostme.com
jsl...@yahoo.com
-------------------------------------------
Internet Pulita
http://jslabs.webhostme.com/spam.asp
 (in allestimento)
-------------------------------------------
S.E.T.I. Project supporter
http://setiathome.ssl.berkeley.edu
news:it.scienza.astronomia.seti
-------------------------------------------

Grazie, Ghizza.
