Java Script And Moving Image
I took the java script from the previous tuition calculator and adjusted a few variables to create a simple calculator. Not sure why my website doesn’t allow the code to work correctly. I’m guessing the plug-ins are restricting any additional code to be implemented into the site unless the code specifically says to cancel out a certain line of code that the plug-in authors added. For the moving image, I went ahead and kept it simple with a somewhat talking fish since I figured it looked kinda funny.
Simple Addition Calculator
<script language=”javascript”>
function calculate () {
var num1, num2, total;
num1 = parseFloat (document.form1.first.value);
num2 = parseFloat (document.form1.second.value);
total = num1 + num2;
document.form1.total.value = “” + total;
}
</script>
<h3> Simple Addition Calculator </h3>
<form name=”form1″>
First: <input type=”text” name=”first” size=”10″ value”” >
<p>
Second: <input type=”text” name=”second” size=”10″ value”” >
<p>
<hr >
Total: <input type=”text” name=”total” size=”10″ value”” >
<p>
<input type=”button” value=”Calculate Total” onclick=”calculate()” >
</form>
Before

After
