链接类

VML

按钮类

标题类

表单类

表格类

菜单类

窗口类

对象类

滚动条

键盘类

框架类

例子类

模拟类

日期类

色彩类

鼠标类

数学类

图片类

文字类

下拉框

样式类

游戏类

状态栏

资料类

字幕类

其它类

 ·计算圆周率
 ·100只鸡
 ·阿拉伯数字转换为英文 
 ·NUMBER对象的增...
 ·装机计算器
 ·三角函数计算
 ·职位
 ·坐标图
 ·科学计算器
您当前位置:好素材首页 -> 网页特效 -> 数学类
查看信息

面积计算器
好素材网 www.HaoSc.com 02月22日 11:49

[查看演示]  源码如下
----------------------------------------------------------
<!-- This script has been in the http://www.javascripts.com Javascript Public Library! -->
<!-- Note that though this material may have been in a public depository, certain author copyright restrictions may apply. -->
<html>
<head>
<style>
<!--
body, p, div,td,input {font:menu;line-height: 150%}
.div { font-family: 宋体; font-size: 12px; line-height: 150% }
-->
</style>
<title>Area Calculator-www.51windows.Net</title>
</head>

<body>
<script language="JavaScript">
function Circle(form)
{form.circleanswer.value = form.circleradius.value * form.circleradius.value * 3.14159265}
function Rec(form)
{form.recanswer.value = form.reclength.value * form.recheight.value}
function Sphere(form)
{form.sphereanswer.value = form.sphereradius.value * form.sphereradius.value * 3.14159265 * 4}
function Square(form)
{form.squareanswer.value = form.squarelength.value * form.squarelength.value}
function Tri(form)
{form.trianswer.value = form.tribase.value * form.triheight.value / 2}
</script>
<form>
<center><h1>Circle</h1>
Enter the radius<input type="text" name="circleradius"><br>
<input type="button" value="Find Area" onClick="Circle(this.form)"><br>
<input type="text" name="circleanswer">square feet<br>
<h1>Rectangle</h1>
Enter the length of one side<input type="text" name="reclength"><br>
Enter the height of one side<input type="text" name="recheight"><br>
<input type="button" value="Find Area" onClick="Rec(this.form)"><br>
<input type="text" name="recanswer">square feet<br>
<h1>Sphere</h1>
Enter the radius<input type="text" name="sphereradius"><br>
<input type="button" value="Find Area" onClick="Sphere(this.form)"><br>
<input type="text" name="sphereanswer">square feet<br>
<h1>Square</h1>
Enter the length of one side<input type="text" name="squarelength"><br>
<input type="button" value="Find Area" onClick="Square(this.form)"><br>
<input type="text" name="squareanswer">square feet<br>
<h1>Triangle</h1>
Enter the length of the base<input type="text" name="tribase"><br>
Enter the height<input type="text" name="triheight"><br>
<input type="button" value="Find Area" onClick="Tri(this.form)"><br>
<input type="text" name="trianswer">square feet
</form>
<br>
<br>
</body>
</html>

<!-- Simba says Roar. -->

<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>


此信息共 1 页 [1]