lap time




JavaScript Source Code 3000: Calculators: Lap Time







































Lap Time







Calculates the average lap split time required to finish a race in the time you enter. Cool!








Number of laps:



Desired time:
: (mm:ss)





Avg. Lap Time:









JavaScript Source Code 3000: Calculators: Lap Time
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- TWO STEPS TO INSTALL LAP TIME:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Geoff Greer (gig0wiz@hotmail.com) -->

<! >
<! >

<!-- Begin
function calc(form) {
var laps = (isNaN( parseInt(form.laps.value) )) ? 0 : parseInt(form.laps.value);
if (laps) {
var minutes = (form.minutes.value == "") ? 0 : parseInt(form.minutes.value);
var seconds = (form.seconds.value == "") ? 0 : parseInt(form.seconds.value);
return( ((minutes * 60 + seconds) / laps) + " seconds");
}
else return ("");
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form name=raceform>
<table border=1 width=300>
<tr>
<td>Number of laps:</td>
<td><input type=text name=laps size=2></td>
</tr>
<tr>
<td>Desired time:</td>
<td><input type=text name=minutes size=2><b>:</b><input type=text name=seconds size=2> (mm:ss)</td>
</tr>
<tr>
<td colspan=2 align=center><input type=button value="Calculate" onclick="this.form.laptime.value=calc(this.form);"></td>
</tr>
<tr>
<td>Avg. Lap Time:</td>
<td><input type=text name=laptime></td>
</tr>
</table>
</form>
</center>



<!-- Script Size: 1.48 KB -->










Wyszukiwarka

Podobne podstrony:
THE CLOCK zegar telling the time podawanie godzin i cwiczenia
The Time Machine Wehikuł czasu FullHD 1080p DTS AC3 5 1
Clawfinger Waste my Time
date time short
The Time of the?rk
date time long
Prepositions of Time
A Tryst in Time
Larry Niven Passing Perry Crater Base, Time Uncertain
Doctor Who Time Crash
HIM One Last Time
Britney Spears Baby One More Time
Sargent Kayme A Question of Time
finished time
Kydland, Prescott Time to Build and Aggregate Fluctuations
java sql Time
C10 Feeding Time

więcej podobnych podstron