Widget:RimCalc: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function(){ | $(document).ready(function () { | ||
$("#calc").click(function(){ | $("#calc").click(function () { | ||
var temp = 0; | var temp = 0; | ||
temp = (140 - parseInt($("#input2").val())) * parseInt($("#input1").val()); | temp = (140 - parseInt($("#input2").val())) * parseInt($("#input1").val()); | ||
console.log(temp); | console.log(temp); | ||
temp = temp / (parseInt($("#input3").val()) * 72) | temp = temp / (parseInt($("#input3").val()) * 72) | ||
console.log(temp); | console.log(temp); | ||
if ($("#input4").is(':checked')) { | if ($("#input4").is(':checked')) { | ||
temp = temp * .85; | temp = temp * .85; | ||
console.log(temp); | console.log(temp); | ||
$("#output").html(temp); | } | ||
$("#output").html(temp); | |||
}); | }); | ||
}); | }); | ||
</script> | </script> | ||
Weight: <input type="text" id="input1" /><br /> | Weight: <input type="text" id="input1" /><br /> |