Skip to content

Instantly share code, notes, and snippets.

@mattkruskamp
Created February 23, 2011 23:56
Show Gist options
  • Save mattkruskamp/841468 to your computer and use it in GitHub Desktop.
Save mattkruskamp/841468 to your computer and use it in GitHub Desktop.
Calling the dive
// standard jquery self-calling function
jQuery(function () {
// get the elements
var psiIn = $("#psiIn"),
psiOut = $("#psiOut"),
time = $("#time"),
depth = $("#depth"),
tankVolume = $("#tankVolume"),
tankWorkingPsi = $("#tankWorkingPsi"),
finalLabel = $("#rate"),
submitButton = $("#submitQuery");
// when you click the submit button
submitButton.live("click", function () {
// get the sac rate
var final = DevelopLive.Dive.calcSac(
psiIn.val(), psiOut.val(), time.val(),
depth.val(), tankVolume.val(), tankWorkingPsi.val());
// set the rate
finalLabel.text(final);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment