爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
时间精确计算程序
时间精确计算程序
日期:2014-05-18 浏览次数:20158 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <script language="Javascript"> <!-- Gracefully hide from old browsers function timestamp_class(this_current_time, this_start_time, this_end_time, this_time_difference) { this.this_current_time = this_current_time; this.this_start_time = this_start_time; this.this_end_time = this_end_time; this.this_time_difference = this_time_difference; this.GetCurrentTime = GetCurrentTime; this.StartTiming = StartTiming; this.EndTiming = EndTiming; } //Get current time from date timestamp function GetCurrentTime() { var my_current_timestamp; my_current_timestamp = new Date(); //stamp current date & time return my_current_timestamp.getTime(); } //Stamp current time as start time and reset display textbox function StartTiming() { this.this_start_time = GetCurrentTime(); //stamp current time document.TimeDisplayForm.TimeDisplayBox.value = 0; //init textbox display to zero } //Stamp current time as stop time, compute elapsed time difference and display in textbox function EndTiming() { this.this_end_time = GetCurrentTime(); //stamp current time this.this_time_difference = (this.this_end_time - this.this_start_time) / 1000; //compute elapsed time document.TimeDisplayForm.TimeDisplayBox.value = this.this_time_difference; //set elapsed time in display box } var time_object = new timestamp_class(0, 0, 0, 0); //create new time object and initialize it //--> </script> <form> <input type="button" value="开始" onClick="time_object.StartTiming()"; name="StartButton"> </form> <form> <input type="button" value="结束" onClick="time_object.EndTiming()"; name="EndButton"> </form> <form name="TimeDisplayForm"> 经过了: <input type="text" name="TimeDisplayBox" size="6"> 秒 </form> <a href="http://www.aiyiweb.com/js/">欢迎访问爱易网JS特效</a>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:固定的挂钟
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
阿朗力避步北电后尘 急切停止自我革新
Line风靡亚洲,在北美却进展缓慢
扎克伯格华裔妻子首度亮相电视节目畅谈情史
170号码扎堆上市:手机话费私人定制时代到来?
工商下月将整治手机市场
网络音乐非片面收费 高晓松时间表难完成
惠普董事长莱恩辞职 为巨额财务减记埋单
中国电信内外受困 去电信化思绪待改
承载京东C2C野心的拍拍网:梦想丰满,现实骨感
推荐阅读
更多>
迅雷欲3300万美元收购金山快盘 预计9月完成
苏宁易购成世界最慢电商 专家称其涉嫌违约
美图手机2问世 三大问题令其市场销量堪忧
二维码支付大战的号角注定已经吹响,尚需标准发放
谷歌安卓全球副总裁为何跳槽中国企业小米?
中国电信内外受困 去电信化思绪待改
余额宝收益率跌破5% 银行系宝宝收益率赶超
看蜗牛如何放水养鱼,盘活生态系统
盘点改变社会的15种科技:谷歌眼镜将使我们成为半机械人
微软大幅调整Bing在华策略:从高大上到接地气
IT时代周刊总编辑曹健:投资人刘志硕印象记
同样的背景,罗永浩和雷军到底有什么不同?
杨元庆去年总薪酬1.33亿元
清点:罗永浩推锤子ROM 小米打法遭模拟
代工厂生活危机:“富士康们”何去何从?
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
微博启动自媒体计划 粉丝+收入双激励是亮点
戴尔正告继续上市存风险 称黑石伊坎方案有缺乏
组建铁塔公司倒逼运营商改革 或加速4G网建设
QQ空间与微信龟兔赛跑,商业生态链陷入死循环