OZONE Asylum
Forums
Distributed Ward
*Sneaks into room*
This page's ID:
13833
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Sorry, If I don't post this here, I'l lose it... <HTML><!-- Thread on Javascript: [url=http://www.ozoneasylum.com/Forum2/HTML/001712.html]http://www.ozoneasylum.com/Forum2/HTML/001712.html[/url] --> <HEAD> <TITLE>Acceleration-Deceleration (08.14.02)</TITLE> <STYLE type="text/css"> BODY{background-color:#000000;color:#FC6203;} H1{color:#FF8800;font-size:18px;} input {margin: 2px;background-color:#999999;color:#FFFFFF} form {position:absolute;top:3;left:400} .floatie{font-size:24px;color:#3366FF;} #castle{position:absolute;font-size:35px;color:#3366FF;top:100;left:150;} </STYLE> <SCRIPT language="Javascript"> //Code by Voodoo 'Doll' Petskull //petskull@nospam.twistedport.com //http://www.twistedport.com var newLeft = 0; var newTop = 0; var lastLeft = 0; var lastTop = 0; function mousetrack(){ //Print out where the mouse is- daForm.mousetracker2000left.value = event.clientX; daForm.mousetracker2000top.value = event.clientY; } function moveThing(){ //Move the layer 'castle'-- // make all the *old* click vars old and all the *new* click vars new // and input it in the status bar lastLeft = newLeft; lastTop = newTop; newLeft = event.clientX; newTop = event.clientY; window.status= "New Location-- Left: "+newLeft+", Top: "+newTop+" Old Location-- Left: "+lastLeft+", Top: "+lastTop; // -----------------------------------------/ // Now figure out the distance between the two- for left and for right..... var disLeft = lastLeft - newLeft; var disTop = lastTop - newTop; window.status= "New Location-- Left: "+newLeft+", Top: "+newTop+" Old Location-- Left: "+lastLeft+", Top: "+lastTop+"-- Distance Between: Left: "+disLeft+", Top: "+disTop; //------------------------------------------/ accdec(lastLeft,lastTop); } function accdec(amtleft,amttop){ //Accelerate-Decelerate depending on proximity-- castle.style.left = amtleft; castle.style.top = amttop; return(this); } </SCRIPT> </HEAD> <BODY ONMOUSEMOVE="mousetrack();" ONMOUSEDOWN="moveThing();"> <H1>Hello, World!</H1> In this daring episode, I will try to make objects move in nifty ways.<BR> For example, acceleration & deceleration. <FORM ID="daForm"> <INPUT name="mousetracker2000left" type="text" READONLY="yes" VALUE="left nuthin'..."> <INPUT name="mousetracker2000top" type="text" READONLY="yes" VALUE="top nuthin'..."><BR> LEFT &n bsp; TOP </FORM> <DIV ID="castle"> <TABLE CLASS="floatie" bgcolor=#3366FF width=30 height=30 border=0 cellpadding=0 cellspacing=1> <TR><TD bgcolor=#000000 cellspacing=1 cellpadding=0 align=center valign=middle>¤</TD></TR> </TABLE> </DIV> </BODY> </HTML> [url=http://www.twistedport.com/profiles/petskull.html] [img]http://www.twistedport.com/misc/petsig13.gif[/img] [/url] [url=http://www.twistedport.com]Code[/url] - [url=http://www.twistedport.com]CGI[/url] - [url=http://www.twistedport.com]links[/url] - [url=http://www.twistedport.com]DHTML[/url] - [url=http://www.twistedport.com]Javascript[/url] - [url=http://www.twistedport.com]Perl[/url] - [url=http://www.twistedport.com"]programming[/url] - [url=http://www.twistedport.com]Magic[/url] - [url=http://www.twistedport.com]http://www.twistedport.com[/url] [i]ICQ: 67751342[/i]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »