爱易网
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 浏览次数:20185 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:固定的挂钟
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
广电地方营业厅的一句“罚停”,暴露出了他们的本质
打车App就是下一个团购骗局!?
新一代iPhone11月底国内上市 支持TD制式
任正非:喜马拉雅山的水为什么不能流入亚马逊河?
马斯克的特斯拉能否保持好势头
如家撤离同程内情:祸起反水OTA“联盟”?
小灵通两年都无信号 顾客起诉联通公司
苹果股价突破100美元大关:投资者看好iPhone 6
TD是完成中国梦的一个契机
推荐阅读
更多>
魅族黄章惹怒芙蓉姐姐 将跨界推女神手机
火一把就死: 百度魔图验证社交游戏衰亡宿命
中国联通困局:遭遇OTT宽带4G三大难题
银联布局二维码支付,“擦边球”生态不能自救
联想架构调整后:Think品牌或推智能手机
评论:马云的成功建立在什么基础上很值得怀疑
网易云音乐能否为丁磊拿到移动互联网门票?
O2O成"唐僧肉":百度糯米抢食第一口令阿里腾讯颤抖
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
固话上网卡或将实名制 运营商泄露用户信息将被罚
喜大普奔:2016年国内乘客有望在飞机上使用手机
凑足了升级ios8所需要的5.7G空间,没料到“苹果”却变成“板砖”,iOS8还能一起愉快玩耍吗?
App Store严禁推送广告 运用面临大清洗
广电总局回应美剧下架:不是所有信息可公开
埃里克杰克森:阿里IPO估值至少1500亿美元
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
史玉柱谈创业:5大建议 失败的教训最真实
公信力消失:马航事件社交媒体传播之痛
虚拟运营商流量不清零吸引用户 盈利待明