🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.javascript
Article #1

Scritp for moving a box over the screen

#1
From: dj vishnu
Date: Thu, 06 Nov 2003 16:16
61 lines
3214 bytes
This is a multi-part message in MIME format.

------=_NextPart_000_004B_01C3A489.C4DBA670
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

im only moving it in y direction, and i want to animate it, but
the setTimeout() doesnt seem to have any effect, i can change the
value and it still runs super fast (it gets to there in a millisecond)

any thoughts why?

var menuPos =3D 584;
var slutt =3D 565;

function initMove(){
 if(!(menuPos=3D=3Dslutt)){
 menuPos =3D menuPos -1;
 document.getElementById('test').style.top =3D menuPos;
 setTimeout(initMove(),5000);
 }
}
------=_NextPart_000_004B_01C3A489.C4DBA670
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>im only moving it in y direction, and i =
want to=20
animate it, but</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the setTimeout() doesnt seem to have =
any effect, i=20
can change the</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>value and it still runs super fast (it =
gets to=20
there in a millisecond)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>any thoughts why?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DVerdana size=3D2><STRONG>var menuPos =3D 584;<BR>var =
slutt =3D=20
565;</STRONG></FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2><STRONG>function=20
initMove(){<BR>&nbsp;if(!(menuPos=3D=3Dslutt)){<BR>&nbsp;menuPos =3D =
menuPos=20
-1;<BR>&nbsp;document.getElementById('test').style.top =3D=20
menuPos;<BR>&nbsp;setTimeout(initMove(),5000);<BR>&nbsp;}<BR>}</STRONG></=
FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_004B_01C3A489.C4DBA670--
Technical Details
Message-ID: <3faa74e0$1@news.broadpark.no>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!nntp.gblx.net!news.broadpark.no

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcc66,bb5a07b155099e43,start
X-Google-Attributes: gidfcc66,public
X-Google-Thread: 100e17,bb5a07b155099e43,start
X-Google-Attributes: gid100e17,public
X-Google-ArrivalTime: 2003-11-06 08:17:58 PST
From: ":+: dj vishnu :+:" <jornsand(at)stud.ntnu.no>
Newsgroups: de.comp.lang.javascript,alive.internet.lang.javascript
Subject: Scritp for moving a box over the screen
Date: Thu, 6 Nov 2003 17:16:51 +0100
Lines: 62
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----=_NextPart_000_004B_01C3A489.C4DBA670"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 80.202.218.246
X-Original-NNTP-Posting-Host: 80.202.218.246
Message-ID: <3faa74e0$1@news.broadpark.no>
X-Trace: news.broadpark.no 1068135648 80.202.218.246 (6 Nov 2003 17:20:48 +0200)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!nntp.gblx.net!news.broadpark.no