Avatar billede aalborg79 Nybegynder
08. februar 2001 - 19:53 Der er 6 kommentarer

mussetrick

nogen som ved hvordan man laver mussegrafik....f.eks. så der følger noget efter musen ?????
Avatar billede htx98i17 Professor
08. februar 2001 - 19:55 #1
et spm må kun oprettes een gang.
http://www.eksperten.dk/spm/48775
Avatar billede jumper Nybegynder
08. februar 2001 - 20:20 #2
Milov har lavet en ganske sød ting til præcis dette:

http://milov.nl/iambald/40.html

/Thor
Avatar billede aalborg79 Nybegynder
08. februar 2001 - 21:40 #3
Kan ikke overskue dit svar...
kan du ikke paste det jeg skal bruge ind (speed 1)
så skal du få dine point =)
Avatar billede visionmagic Nybegynder
09. februar 2001 - 15:50 #4
<html><head><title>40</title>

<!--

    40 seems to work a lot smoother in IE than in Netscape, btw.

-->

<script language=\"Javascript1.2\">
    NN = document.layers ? 1 : 0;
    IE = document.all ? 1 : 0;
   
    totC = 7;
    cTimers = new Array(totC);
    cWait = 500;
    isFreeze = 0;
    mouseX = 0;
    mouseY = 0;
   
    pl = new Image(); pl.src = \'40_wait.gif\';

    function doLoad() {
        if (NN) document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = doMouseMove;
        if (NN) document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown = doMouseDown;
        if (NN) document.captureEvents(Event.KEYDOWN);
        document.onkeydown = doKeyDown;
    }
   
   
    ///// FREEZE FUNCTION, EXECUTED WHEN MOUSE-BUTTON IS PRESSED /////
    function doMouseDown(e) {
        isFreeze    = (isFreeze) ? 0 : 1;
        var cSource  = (isFreeze) ? \'40_wait.gif\' : \'40_cursor.gif\';

        for (var i=0; i<totC; i++) {
            chi(\'c\'+i, \'ci\'+i, cSource);
            if (cTimers[i] && isFreeze) clearTimeout(cTimers[i]);
        }
    }
   

    ////// WHEN MOUSE IS MOVED, ADJUST LOCATION OF CURSOR 0 ////
    function doMouseMove(e) {
        mouseX = NN ? e.pageX : (event.clientX + document.body.scrollLeft);
        mouseY = NN ? e.pageY : (event.clientY + document.body.scrollTop);
       
        if (!isFreeze) cTimers[0] = setTimeout(\'adjCursor(\'+0+\',\'+mouseX+\',\'+mouseY+\')\', cWait);
    }


    ////// ADJUST LOCATION OF CURSOR c, THEN CURSOR c+1, THEN CURSOR c+2... ///////   
    function adjCursor(c,x,y) {
        if (IE) with(document.all[\'c\'+c].style) { left = x; top  = y; }
        if (NN) {document.layers[\'c\'+c].left = x;
            document.layers[\'c\'+c].top  = y;
        }
       
        if (c < totC-1 && !isFreeze)
            cTimers[c] = setTimeout(\'adjCursor(\' + (c+1) + \',\' + x + \',\' + y + \')\', cWait);   
    }
   

   
    //////  ADJUST CURSOR DELAY AND GUI WHEN KEY PRESSED  /////////
    function doKeyDown(e) {
        kc = (NN) ? e.which : event.keyCode;
        n  = parseInt(String.fromCharCode(kc));
       
        if (!isNaN(n) && n != 0) {
            cWait = n*100;
            for (var i=1; i<10; i++) chi(\'\',\'d\'+i,\'8_trans.gif\');
            chi(\'\',\'d\'+n,\'40_black.gif\');
           
            isFreeze    = 0;
            var cSource  = (isFreeze) ? \'40_wait.gif\' : \'40_cursor.gif\';
   
            for (var i=0; i<totC; i++) {
                chi(\'c\'+i, \'ci\'+i, cSource);
                if (cTimers[i] && isFreeze) clearTimeout(cTimers[i]);
            }
        }
    }


    ///// PLAIN OL\' IMG CHANGING FUNCTION //////
    function chi(id,iName,newSrc) {
        if (NN && id) document.layers[id].document.images[iName].src = newSrc;
        else document.images[iName].src = newSrc;
    }
   
   
   
</script>

</head>

<body bgcolor=\"#999999\" onLoad=\"doLoad();\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">


<table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr><td valign=\"top\" align=\"left\">

<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td rowspan=\"4\" width=\"5\"> </td><td height=\"5\"> </td></tr>
<tr><td colspan=\"3\" bgcolor=\"#CCCCCC\"><img src=\"40_gui_top.gif\" width=\"145\" height=\"36\" alt=\"\"></td></tr>
<tr>
<td align=\"left\"><img src=\"40_black.gif\" width=\"1\" height=\"1\" alt=\"\"></td>
<td align=\"center\" bgcolor=\"#CCCCCC\"><img name=\"d1\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d2\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d3\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d4\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d5\"  src=\"40_black.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d6\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d7\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d8\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"><img src=\"8_trans.gif\" width=\"6\" height=\"1\" alt=\"\"><img name=\"d9\" src=\"8_trans.gif\" width=\"8\" height=\"1\" alt=\"\"></td>
<td align=\"right\"><img src=\"40_black.gif\" width=\"1\" height=\"1\" alt=\"\"></td>
</tr>
<tr><td colspan=\"3\" bgcolor=\"#CCCCCC\"><img src=\"40_gui_bottom.gif\" width=\"145\" height=\"3\" alt=\"\"></td></tr>
</table>

</td></tr>
<tr><td valign=\"bottom\" align=\"right\">

    <img src=\"40_lfb.gif\" width=\"233\" height=\"25\" alt=\"\">
   
</td></tr>
</table>

<div id=\"c6\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci6\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c5\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci5\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c4\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci4\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c3\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci3\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c2\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci2\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c1\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci1\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>
<div id=\"c0\" style=\"position:absolute;width:13;left:-50\"><img name=\"ci0\" src=\"40_cursor.gif\" width=\"13\" height=\"22\" alt=\"\"></div>


</body>
</html>
Avatar billede aalborg79 Nybegynder
10. februar 2001 - 16:16 #5
ja...det er jo kildekoden...den kunne jeg også copy paste.....men jeg vil bare have den til speed 1
Avatar billede bacha Nybegynder
04. marts 2001 - 15:19 #6
Se www.viewsource.dk , der kan du finde mange forskellige mousetrails bl.a:

PASTE THIS SCRIPT INTO YOUR HEAD TAG:

<SCRIPT language=\"Javascript1.2\">
<!--


var isNS = (navigator.appName == \"Netscape\");
layerRef = (isNS) ? \"document\" : \"document.all\";
styleRef = (isNS) ? \"\" : \".style\";

var queue = new Array();

var NUM_OF_TRAIL_PARTS = 5

for (x=1; x < 6; x++) {
    eval(\"trailSpriteFrame\" + x + \" = new Image(28,36);\");
    eval(\"trailSpriteFrame\" + x + \".src = \'trailgif\" + x + \".gif\';\");
}


function trailSpriteObj(anID) {
    this.trailSpriteID = \"trailSprite\" + anID;
    this.imgRef = \"trailSprite\" + anID + \"img\";
    this.currentFrame = 1;
    this.animateTrailSprite = animateTrailSprite;
}

function animateTrailSprite() {
    if (this.currentFrame <6 ) {
        if (isNS) {
            eval(\"document.\" + this.trailSpriteID +\".document[\'\"+ this.imgRef + \"\'].src  =  trailSpriteFrame\" + this.currentFrame + \".src\");
        } else {
            eval(\"document[\'\" + this.imgRef + \"\'].src  =  trailSpriteFrame\" + this.currentFrame + \".src\");
        }
        this.currentFrame ++;
    } else {
        eval(layerRef + \'.\' + this.trailSpriteID +  styleRef + \'.visibility = \"hidden\"\');
    }   
}



function processAnim() {
    for(x=0; x < NUM_OF_TRAIL_PARTS; x++)
            queue[x].animateTrailSprite();
}

function processMouse(e) {
    currentObj = shuffleQueue();
    if (isNS) {
        eval(\"document.\" + currentObj + \".left = e.pageX - 10 ;\");
        eval(\"document.\" + currentObj + \".top = e.pageY + 10;\");
    } else {
        eval(\"document.all.\" + currentObj + \".style.pixelLeft = event.clientX + document.body.scrollLeft - 10 ;\");
        eval(\"document.all.\" + currentObj + \".style.pixelTop = event.clientY + document.body.scrollTop + 10;\");
    }
}

function shuffleQueue() {
    lastItemPos = queue.length - 1;
    lastItem = queue[lastItemPos];
    for (i = lastItemPos; i>0; i--)
        queue[i] = queue[i-1];
    queue[0] = lastItem;
   
    queue[0].currentFrame = 1;
    eval(layerRef + \'.\' + queue[0].trailSpriteID +  styleRef + \'.visibility = \"visible\"\');   

    return     queue[0].trailSpriteID;
}

function init() {
   
    for(x=0; x<NUM_OF_TRAIL_PARTS; x++)
        queue[x] = new trailSpriteObj(x+1) ;
   
    if (isNS) { document.captureEvents(Event.MOUSEMOVE); }
    document.onmousemove = processMouse;

    setInterval(\"processAnim();\",25);
}   
if (document.all||document.layers)
window.onload = init;

//-->
</SCRIPT>




PASTE THIS SCRIPT INTO YOUR BODY TAG


<DIV id=\"trailSprite1\" style=\"position: absolute; height:28px; width:36px;z-index: 100\">
<img src=\"blanktrail.gif\" height=28 width=36 border=0 name=\"trailSprite1img\">
</DIV>
<DIV id=\"trailSprite2\" style=\"position: absolute; height:28px; width:26px;z-index: 10\">
<img src=\"blanktrail.gif\" height=28 width=36 border=0 name=\"trailSprite2img\">
</DIV>
<DIV id=\"trailSprite3\" style=\"position: absolute; height:28px; width:36px;z-index: 10\">
<img src=\"blanktrail.gif\" height=28 width=36 border=0 name=\"trailSprite3img\">
</DIV>
<DIV id=\"trailSprite4\" style=\"position: absolute; height:28px; width:36px;z-index: 10\">
<img src=\"blanktrail.gif\" height=28 width=36 border=0 name=\"trailSprite4img\">
</DIV>
<DIV id=\"trailSprite5\" style=\"position: absolute; height:28px; width:36px;z-index: 10\">
<img src=\"blanktrail.gif\" height=28 width=36 border=0 name=\"trailSprite5img\">
</DIV>
<script language=\"JavaScript1.2\">
if (document.all&&window.print)
document.body.style.cssText=\"overflow-x:hidden;overflow-y:scroll\"
</script>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester