网页特效
建站首页
|
广告代码
|
源码下载
|
站长工具
|
字体下载
|
网页模板
|
收藏本站
|
设为首页
网站首页
菜单导航
日期时间
背景图像
图层样式
鼠标键盘
页面窗口
色彩表格
链接文字
表单按钮
计数转换
游戏娱乐
综合实例
特效
热门搜索:
特效代码
js脚本
导航菜单
热点推荐:
英文字体
人民币汇率
dw插件
站长常用软件
alexa排名查询
您的位置:
网页特效
->
计数转换
-> 度衡量换算 -- 体积和容积换算网页代码
度衡量换算 -- 体积和容积换算网页代码
作者:度衡量换算 -- 体积和容积换算 发布时间:2007-11-22 0:03:10 发布人: admin
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>jz123.cn,度衡量换算 -- 体积和容积换算</title> <script language="JScript" type="text/JScript"> function VOL_MEASURES() { this.mCubic_meter = 1000 this.mHectoliter = 100 this.mDekaliter = 10 this.mLiter = 1 this.mDeciliter = 0.1 this.mCentiliter = 0.01 this.mMilliliter = 0.001 this.mCubic_millimeter = 0.000001 this.mcTable_spoon= 0.015 this.mcTea_spoon= 0.005 this.uscCubic_inch = 0.016387064 this.uscAcre_foot = 43560 * 1728 * this.uscCubic_inch this.uscCubic_yard = 27 * 1728 * this.uscCubic_inch this.uscCubic_foot = 1728 * this.uscCubic_inch this.uslGallon = 231 * this.uscCubic_inch this.uslBarrel = 42 * this.uslGallon this.uslQuart = this.uslGallon / 4 this.uslPint = this.uslGallon / 8 this.uslGill = this.uslGallon / 32 this.uslFluid_ounce = this.uslGallon / 128 this.uslFluid_dram = this.uslGallon / 1024 this.uslMinim = this.uslFluid_ounce / 61440 this.usdBarrel = 7056 * this.uscCubic_inch this.usdBushel = 2150.42 * this.uscCubic_inch this.usdPeck = this.usdBushel / 4 this.usdQuart = this.usdBushel / 32 this.usdPint = this.usdBushel / 64 this.uscCup = 8 * this.uslFluid_ounce this.uscTable_spoon = this.uslFluid_ounce / 2 this.uscTea_spoon = this.uslFluid_ounce / 6 this.briGallon = 4.54609 this.briBarrel = 36 * this.briGallon this.briBushel = 8 * this.briGallon this.briPint = this.briGallon / 8 this.briFluid_ounce = this.briGallon / 160 } var vol_data = new VOL_MEASURES(); function checkNum(str) { for (var i=0; i<str.length; i++) { var ch = str.substring(i, i + 1) if (ch!="." && ch!="+" && ch!="-" && ch!="e" && ch!="E" && (ch < "0" || ch > "9")) { alert("请输入有效的数字"); return false; } } return true } function normalize(what,digits) { var str=""+what; var pp=Math.max(str.lastIndexOf("+"),str.lastIndexOf("-")); var idot=str.indexOf("."); if (idot>=1) { var ee=(pp>0)?str.substring(pp-1,str.length):""; digits+=idot; if (digits>=str.length) return str; if (pp>0 && digits>=pp) digits-=pp; var c=eval(str.charAt(digits)); var ipos=digits-1; if (c>=5) { while (str.charAt(ipos)=="9") ipos--; if (str.charAt(ipos)==".") { var nc=eval(str.substring(0,idot))+1; if (nc==10 && ee.length>0) { nc=1; ee="e"+(eval(ee.substring(1,ee.length))+1); } return ""+nc+ee; } return str.substring(0,ipos)+(eval(str.charAt(ipos))+1)+ee; } else var ret=str.substring(0,digits)+ee; for (var i=0; i<ret.length; i++) if (ret.charAt(i)>"0" && ret.charAt(i)<="9") return ret; return str; } return str; } function compute(obj,val,data) { if (obj[val].value) { var uval=0; uval = obj[val].value*data[val]; if( (uval >= 0) && (obj[val].value.indexOf("-") != -1) ) { uval = -uval; // *** Hack for Opera 4.0 2000-10-14 } for (var i in data) obj[i].value=normalize(uval/data[i],8); } } function resetValues(form,data) { for (var i in data) form[i].value=""; } function resetAll(form) { resetValues(form,vol_data); } </script> </head> <body class="bodycolor" topmargin="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="small"> <tbody> <tr> <td align="center" valign="top"><br> <form action=""> <table width="75%" cellpadding="4" cellspacing="0" class="small"> <tbody> <tr align="left"> <td colspan="6"> 可实现立方米(Cubic meter)、公石(hectoliter)、十升(dekaliter)、立方分米(Cubic dm)、升(liter)、分升(deciliter)、厘升(centiliter)、立方厘米(Cubic cm)、毫升(milliliter)、立方毫米(Cubic millimeter)、桶(Barrel)、蒲式耳(Bushel)、配克(Peck)、夸脱(Quart)、品脱(Pint)、加仑(Gallon)、盎司(Ounce)、打兰(dram)、量滴(Minim)、立方码(Cubic yard)、立方英尺(Cubic foot)、立方英寸(Cubic inch)间的互转互换。</td> </tr> <tr align="center"> <td colspan="6"><b> 公 制</b> <hr size="1"></td> </tr> <tr> <td nowrap align="right">立方米(m<sup>3</sup>)</td> <td align="left"><input size="12" name="mCubic_meter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mCubic_meter.value)) compute(this.form,mCubic_meter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mCubic_meter_bt"></td> <td nowrap align="right">公石(hl)</td> <td align="left"><input size="12" name="mHectoliter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mHectoliter.value)) compute(this.form,mHectoliter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mHectoliter_bt"></td> </tr> <tr> <td nowrap align="right">十升(dal)</td> <td align="left"><input size="12" name="mDekaliter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mDekaliter.value)) compute(this.form,mDekaliter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mDekaliter_bt"></td> <td nowrap align="right">立方分米(dm<sup>3</sup>)=升(l)</td> <td align="left"><input size="12" name="mLiter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mLiter.value)) compute(this.form,mLiter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mLiter_bt"></td> </tr> <tr> <td nowrap align="right">分升(dl)</td> <td align="left"><input size="12" name="mDeciliter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mDeciliter.value)) compute(this.form,mDeciliter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mDeciliter_bt"></td> <td nowrap align="right">厘升(cl)</td> <td align="left"><input size="12" name="mCentiliter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mCentiliter.value)) compute(this.form,mCentiliter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mCentiliter_bt"></td> </tr> <tr> <td nowrap align="right">立方厘米(cm<sup>3</sup>)=毫升(ml)</td> <td align="left"><input size="12" name="mMilliliter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mMilliliter.value)) compute(this.form,mMilliliter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mMilliliter_bt"></td> <td nowrap align="right">立方毫米(mm<sup>3</sup>)</td> <td align="left"><input size="12" name="mCubic_millimeter" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mCubic_millimeter.value)) compute(this.form,mCubic_millimeter.name,vol_data)" type="button" value="换算" class="SmallButton" name="mCubic_millimeter_bt"></td> </tr> <tr align="center"> <td colspan="6"><b> 美制干量</b> <hr size="1"> </td> </tr> <tr> <td nowrap align="right">桶</td> <td align="left"><input size="12" name="usdBarrel" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(usdBarrel.value)) compute(this.form,usdBarrel.name,vol_data)" type="button" value="换算" class="SmallButton" name="usdBarrel_bt"></td> <td nowrap align="right">蒲式耳(bu)</td> <td align="left"><input size="12" name="usdBushel" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(usdBushel.value)) compute(this.form,usdBushel.name,vol_data)" type="button" value="换算" class="SmallButton" name="usdBushel_bt"></td> </tr> <tr> <td nowrap align="right">配克(pk)</td> <td align="left"><input size="12" name="usdPeck" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(usdPeck.value)) compute(this.form,usdPeck.name,vol_data)" type="button" value="换算" class="SmallButton" name="usdPeck_bt"></td> <td nowrap align="right">夸脱(qt)</td> <td align="left"><input size="12" name="usdQuart" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(usdQuart.value)) compute(this.form,usdQuart.name,vol_data)" type="button" value="换算" class="SmallButton" name="usdQuart_bt"></td> </tr> <tr> <td nowrap align="right">品脱(pt)</td> <td align="left"><input size="12" name="usdPint" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(usdPint.value)) compute(this.form,usdPint.name,vol_data)" type="button" value="换算" class="SmallButton" name="usdPint_bt"></td> <td colspan="3"></td> </tr> <tr align="center"> <td colspan="6"><b> 英制液量和干量</b> <hr size="1"> </td> </tr> <tr> <td nowrap align="right">桶</td> <td align="left"><input size="12" name="briBarrel" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(briBarrel.value)) compute(this.form,briBarrel.name,vol_data)" type="button" value="换算" class="SmallButton" name="briBarrel_bt"></td> <td nowrap align="right">蒲式耳</td> <td align="left"><input size="12" name="briBushel" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(briBushel.value)) compute(this.form,briBushel.name,vol_data)" type="button" value="换算" class="SmallButton" name="briBushel_bt"></td> </tr> <tr> <td nowrap align="right">加仑(bal)</td> <td align="left"><input size="12" name="briGallon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(briGallon.value)) compute(this.form,briGallon.name,vol_data)" type="button" value="换算" class="SmallButton" name="briGallon_bt"></td> <td nowrap align="right">品脱(pt)</td> <td align="left"><input size="12" name="briPint" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(briPint.value)) compute(this.form,briPint.name,vol_data)" type="button" value="换算" class="SmallButton" name="briPint_bt"></td> </tr> <tr> <td nowrap align="right">液量盎司(fl oz)</td> <td align="left"><input size="12" name="briFluid_ounce" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(briFluid_ounce.value)) compute(this.form,briFluid_ounce.name,vol_data)" type="button" value="换算" class="SmallButton" name="briFluid_ounce_bt"></td> <td colspan="3"></td> </tr> <tr align="center"> <td colspan="6"><b> 公制烹调制式</b> <hr size="1"> </td> </tr> <tr> <td nowrap align="right">汤勺(Table spoon)</td> <td align="left"><input size="12" name="mcTable_spoon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mcTable_spoon.value)) compute(this.form,mcTable_spoon.name,vol_data)" type="button" value="换算" class="SmallButton" name="mcTable_spoon_bt"></td> <td nowrap align="right">调羹(Tea spoon)</td> <td align="left"><input size="12" name="mcTea_spoon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(mcTea_spoon.value)) compute(this.form,mcTea_spoon.name,vol_data)" type="button" value="换算" class="SmallButton" name="mcTea_spoon_bt"></td> </tr> <tr align="center"> <td colspan="6"><b> 美制烹调制式</b> <hr size="1"> </td> <tr> <td nowrap align="right">汤勺(Tbs)</td> <td align="left"><input size="12" name="uscTable_spoon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscTable_spoon.value)) compute(this.form,uscTable_spoon.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscTable_spoon_bt"></td> <td nowrap align="right">调羹(tsp)</td> <td align="left"><input size="12" name="uscTea_spoon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscTea_spoon.value)) compute(this.form,uscTea_spoon.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscTea_spoon_bt"></td> </tr> <tr> <td nowrap align="right">杯(fl oz)</td> <td align="left"><input size="12" name="uscCup" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscCup.value)) compute(this.form,uscCup.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscCup_bt"></td> <td colspan="3"></td> </tr> <tr align="center"> <td colspan="6"><b> 美制液量</b> <hr size="1"> </td> </tr> <tr> <td nowrap align="right">桶[42加仑]</td> <td align="left"><input size="12" name="uslBarrel" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslBarrel.value)) compute(this.form,uslBarrel.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslBarrel_bt"></td> <td nowrap align="right">加仑(gal)</td> <td align="left"><input size="12" name="uslGallon" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslGallon.value)) compute(this.form,uslGallon.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslGallon_spoon_bt"></td> </tr> <tr> <td nowrap align="right">夸脱(qt)</td> <td align="left"><input size="12" name="uslQuart" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslQuart.value)) compute(this.form,uslQuart.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslQuart_bt"></td> <td nowrap align="right">品脱(pt)</td> <td align="left"><input size="12" name="uslPint" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslPint.value)) compute(this.form,uslPint.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslPint_bt"></td> </tr> <tr> <td nowrap align="right">及耳(gi)</td> <td align="left"><input size="12" name="uslGill" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslGill.value)) compute(this.form,uslGill.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslGill_bt"></td> <td nowrap align="right">液量盎司(fl oz)</td> <td align="left"><input size="12" name="uslFluid_ounce" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslFluid_ounce.value)) compute(this.form,uslFluid_ounce.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslFluid_ounce_bt"></td> </tr> <tr> <td nowrap align="right">液量打兰(fl dr)</td> <td align="left"><input size="12" name="uslFluid_dram" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslFluid_dram.value)) compute(this.form,uslFluid_dram.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslFluid_dram_bt"></td> <td nowrap align="right">量滴(min)</td> <td align="left"><input size="12" name="uslMinim" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uslMinim.value)) compute(this.form,uslMinim.name,vol_data)" type="button" value="换算" class="SmallButton" name="uslMinim_bt"></td> </tr> <tr align="center"> <td colspan="6"><b> 美英同制体积计量</b> <hr size="1"> </td> </tr> <tr> <td nowrap align="right">亩英尺</td> <td align="left"><input size="12" name="uscAcre_foot" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscAcre_foot.value)) compute(this.form,uscAcre_foot.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscAcre_foot_bt"></td> <td nowrap align="right">立方码</td> <td align="left"><input size="12" name="uscCubic_yard" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscCubic_yard.value)) compute(this.form,uscCubic_yard.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscCubic_yard_bt"></td> </tr> <tr> <td nowrap align="right">立方英尺</td> <td align="left"><input size="12" name="uscCubic_foot" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscCubic_foot.value)) compute(this.form,uscCubic_foot.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscCubic_foot_bt"></td> <td nowrap align="right">立方英寸</td> <td align="left"><input size="12" name="uscCubic_inch" class="SmallInput"></td> <td align="left"><input onclick="if (checkNum(uscCubic_inch.value)) compute(this.form,uscCubic_inch.name,vol_data)" type="button" value="换算" class="SmallButton" name="uscCubic_inch_bt"></td> </tr> </tbody> </table> <div align="right"> <div align="center"> <input onclick="resetAll(this.form)" type="button" value="数据重置" class="SmallButton" name="res7"> </div> </div> </form></td> </tr> </tbody> </table> </body> </html>
度衡量换算 -- 体积和容积换算网页特效代码
将本文收藏到QQ书签与更多好友分享
上一篇:文章:
度衡量换算 -- 面积换算网页代码
下一篇:文章:
度衡量换算 -- 重量换算网页代码
本类浏览排行 »
搜索页面中的内容
又一款综合搜索引擎代码
标题栏显示当前时间
倒影效果的电子表,显示当前时间
自动记录当前页面最新的更新日期
JS让网页每隔2秒弹出一次对话框
一款超酷的CSS列表排行榜
鼠标悬停放大的纯CSS分页效果
本站推荐文章 »
垂直三栏自适应等高布局
仿QQ消息管理器的文本内容样式
支付宝的控制台动画效果菜单
文字、图片拖曳移动
可拉伸移动的DIV层效果
很酷的图片伸缩放大功能
较好的视觉效果的网页选项卡
CSS实例:通过定义渐变边框给图片加阴影