Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Reaction - Button
(Netscape only) Just how fast can you react? Play this little JavaScript wonder and find out.
Insert into <HEAD>
<HEAD><SCRIPT LANGUAGE="JavaScript"> <!-- Begin function rnd() { r1=new Date(); num=Math.round(Math.abs(Math.sin(r1.getTime())*10000000))%5; return num; } function start() { if(q==1){return} c=0; ad=0; da=0; setTimeout("spel()",1000+1000*rnd()); document.ful.text8.value="wait..."; } function stop() { if(da==1){return} if(ad==1){return} if(q==1){return} if(c==0){fusk()} if(c==0){return} da=1 rak(); } function rak() { slutTime=new Date(); sltid=slutTime.getTime(); tidpo=(sltid-stid)/1000 if (ad==1)tidpo=2; tidtot=tidtot+tidpo; as="";if (tidtot<1)as="0" document.ful.text6.value="Total time: " +as+Math.round(tidtot*100)/100+" seconds" as=""; if (tidpo<1) as="0" if(ad==0){ if (k==1)document.ful.text1.value="Reaction time 1: "+as+tidpo+" seconds" if (k==2)document.ful.text2.value="Reaction time 2: "+as+tidpo+" seconds" if (k==3)document.ful.text3.value="Reaction time 3: "+as+tidpo+" seconds" if (k==4)document.ful.text4.value="Reaction time 4: "+as+tidpo+" seconds" if (k==5)document.ful.text5.value="Reaction time 5: "+as+tidpo+" seconds" document.ful.text8.value="Push Start"; } as="";if (tidtot<1)as="0" document.ful.text6.value="Total time: " +as+Math.round(tidtot*100)/100+" seconds" as="";if (tidtot/k<1)as="0" document.ful.text7.value="Avg. time: " +as+Math.round(tidtot*10000/(k*100))/100+" seconds" if(k>4){ q=1 document.ful.text8.value="Game Over..."; } } function spel() { if (ad==1)return k=k+1 c=1; startTime=new Date(); stid=startTime.getTime(); document.ful.text8.value="PUSH STOP!!!"; } function fusk() { document.ful.text8.value="Too soon. 2 sec penalty. Push start!" ad=1 stid=0; rak(); } tidtot=0; k=0; q=0; ad=0; // End --> </SCRIPT>
Insert into <BODY>
<BODY> <CENTER> <FORM name=ful> <INPUT SIZE=30 NAME="text1" value="Reaction time 1:"><br> <INPUT SIZE=30 NAME="text2" value="Reaction time 2:"><br> <INPUT SIZE=30 NAME="text3" value="Reaction time 3:"><br> <INPUT SIZE=30 NAME="text4" value="Reaction time 4:"><br> <INPUT SIZE=30 NAME="text5" value="Reaction time 5:"><p> <INPUT SIZE=30 NAME="text6" value="Total time: "><br> <INPUT SIZE=30 NAME="text7" value="Avg. time: "><p> <INPUT SIZE=30 NAME="text8" value="Push Start"><br> <INPUT TYPE="button" VALUE="Start" onClick="start()"> <INPUT TYPE="button" VALUE="STOP" onClick="stop()"><p> <INPUT TYPE="button" VALUE="New Game" onClick="history.go(0)"> </FORM> </CENTER>
Other Options