爱易网
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 浏览次数:20198 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:固定的挂钟
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
解析2014年阿里百度等五大互联网巨头深度布局
迅雷再次在美提交IPO申请
MIUI,有了它小米就无惧对手
用户喊话当当网:我彻底把你们丢弃了
传运营商高层将变化 专家称需体制革新
百度吴恩达:图像和音视频搜索是人工智能新方向
运营商补贴减少 国内通信业拐点逼近
阿里马云:我觉得互联网还有十年可以做
称产品遭诋毁 奇虎再诉百度
推荐阅读
更多>
评论:马云的成功建立在什么基础上很值得怀疑
传4G牌照国庆节前后发放 TD-LTE制式优先
史上最严电话实名制9月实行 三大难题待解
富士康欲用机器人产iPhone 6
一大波智能路由器正在袭来:小米、360、极路由大PK
联通丹东公司一高管造假套出手机变卖被判刑7年
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
华为坚持不上市究竟为何?不差钱也不想冒风险
9158屌丝逆袭 从在线“夜总会”转型KTV
独立工具APP:为亿级用户的商业化而愁
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
中移动财报外的"五座大山":运营商沦为走秀陪衬
盛大游戏走向衰落的根源:免费游戏模式惹的祸
国网公司将加快组建 业界人士称困难重重
中电信国际漫游费下调85% 世界杯上网28元/天
阿里巴巴上市后雅虎将面临更大的业绩压力
佳能利润大跌三成 智能终端倒逼相机厂商转型
代工厂生活危机:“富士康们”何去何从?
Android版WhatsApp曝漏洞:聊天记录可被窃取
移动联通回应税率改革:短期内收入利润将大减