[thelist] Help modify a JS

Le Sauvage sauvage at ureach.com
Mon Oct 21 12:23:00 CDT 2002


Hi, Karen,

You are so kind that I feel embarrassed to ask again, but I hate it when I
can't get something to work :-(

I have effected the changes you suggested, but it is not working still. Please
refer to the full html document below. Maybe I made a boo boo somewhere?.

Please do not lose sleep over this. Take your time. And if some other equally
kind souls would like to help, they (also) will have my eternal gratitude.

I owe you one, Karen.

Many, many thanks.

Kris


<HTML><HEAD><SCRIPT  LANGUAGE="JavaScript1.2"><!--

// Animation parameters
startX = 900; startY = 500; endX = 0; endY = 501;
deltaX = -1; //minus 1 should cause the image to move left by 1 pixel increment
deltaY = 0; // strange as it may appear, this should be 0
movePeriod = 50;

// Animation code
function movement() {
  if(currentY <= endY || currentX <= endX) {
   currentX = startX;
   currentY = startY;
   } else {
   currentX -= deltaX;
   currentY -= deltaY;
   }
  }

function setPosition(x,y) {
 divStyle.left = currentX;
 divStyle.top = currentY;
 }

function moveDiv() {
 movement();
 setPosition();
}

    function moveImage() {
       if (document.getElementById)
          divStyle = document.getElementById("mi").style;
       else if (document.all) {
          document.all = document;
          document.all.mi.style = document.all.mi;
          divStyle = document.all.mi.style;
       }
       currentX = startX;
       currentY = startY;
       setPosition(currentX, currentY);
       divStyle.visibility = "visible";
       setInterval("moveDiv()",movePeriod);
    }

window.onload = moveImage;
//--></SCRIPT>
</head><body bgcolor="#ffffff">
<DIV ID="mi" STYLE="position:absolute;visibility:hidden">
<IMG SRC="whatever.gif" alt="image description" WIDTH="80" HEIGHT="80">
</DIV>
</BODY></HTML>

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag



More information about the thelist mailing list