>
设为首页
>
收藏本站
>
最新电影
首页
运营资讯
今日英语
图形图像
计算机技术
Asp编程
网站结构化
资源共享
休闲娱乐
访问新站
您现在的位置:
首页
=>
后台技术
=>
脚本特效
=>
时间日期
订阅本栏目
时间跳动器
时间: 2007-10-04 22:27:35 阅读次数:1801
<html> <head> <title>网页特效|www.ffasp.com 飞飞Asp乐园|---时间跳动器</title> <style type="text/css"> <!-- body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px} A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none } A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline } a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 } --> </style> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script language="JavaScript"> <!-- Hide this script from old browsers -- function modRange (value, min, max) { if (min == max) { return (min) } var low = Math.min (min, max) var high = Math.max (min, max) var range = high - low + 1 var valOff = parseInt (value) - low var mod = range * Math.floor (valOff / range) result = low + valOff - mod if (result < low) { result += high } if (result > high) { result = low } return (result) } function array () { this[0] = null } function timerAppStart () { this.stop () this.loop () } function timerAppStop () { clearTimeout (this.timeout) this.timeout = null } function timerAppToggle () { if (this.timeout) { this.stop () } else { this.start () } } function timerAppLoop () { this.update () command = this.name + '.loop()' for (var i = 0; i < this.syncCount; i++) { if (this.syncName[i] != '') { if (--this.syncCountdown[i] <= 0) { this.syncCountdown[i] = this.syncInterval[i] command += ';' + this.syncName[i] + '.update()' } } } this.timeout = setTimeout (command, this.interval) } function timerAppSetOutput (output) { if (! this.output) { this.output = output } } function timerAppSetInterval (interval) { if (interval) { var newInterval = parseInt (interval) if (newInterval > 0) { this.interval = newInterval } else { alert ('Interval value must be a positive number: ' + interval) } } } function timerAppSync (name, interval) { if (interval == null) { interval = 1 } if (interval <= 0) { eval (this.name + '.unsync("' + name + '")') return } var newIndex = this.syncCount for (var i = 0; i < this.syncCount; i++) { if (this.syncName[i] == name) { newIndex = i break } } if (newIndex == this.syncCount) { this.syncCount++ } this.syncInterval[newIndex] = interval this.syncCountdown[newIndex] = interval this.syncName[newIndex] = name } function timerAppUnsync (name) { for (var i = 0; i < this.syncCount; i++) { if (this.syncName[i] == name) { this.syncName[i] = '' if (i == (this.syncCount - 1)) { this.syncCount-- } } } } function timerAppSetIncrement (increment) { if (increment) { var newIncrement = parseInt (increment) //*Unix only* if (! isNan (newIncrement)) { if (newIncrement != 0) { this.increment = newIncrement } else { alert ('Increment value must be a number: ' + increment) } } } function timerAppSetBounce (bounce) { if (bounce) { var newBounce = parseInt (bounce) //*Unix only* if (! isNan (newBounce)) { if (newBounce != 0) { this.bounce = newBounce } else { alert ('Bounce value must be a number: ' + bounce) } } } function timerAppSetOffset (offset) { if (offset) { var newOffset = parseInt (offset) if ((newOffset > 0) && (newOffset <= this.output.length)) { this.offset = newOffset } else { warnMessage = 'Value of offset must be a valid index (0 - ' + this.output.length + '): ' + offset alert (warnMessage) } } } function clock (name, output, interval) { // Initialize with default values this.name = name // object name, needed for setTimeout this.output = null // output area this.interval = 1000 // milliseconds this.timeout = null this.syncCount = 0 this.syncName = new array () this.syncInterval = new array () this.syncCountdown = new array () // Define object methods this.update = clockUpdate this.start = timerAppStart this.stop = timerAppStop this.toggle = timerAppToggle this.loop = timerAppLoop this.setOutput = timerAppSetOutput this.setInterval = timerAppSetInterval this.sync = timerAppSync this.unsync = timerAppUnsync // Initialize with specified values this.setOutput (output) this.setInterval (interval) this.start() } function clockUpdate () { var now = new Date() var timeHH = now.getHours(); var timeMM = now.getMinutes() var timeSS = now.getSeconds() var msec = now.getTime () var timeSSm = msec - 1000 * Math.floor (msec / 1000) timeSSm = '00' + timeSSm timeSSm = timeSSm.substring(timeSSm.length-3, timeSSm.length) var timeString = ((timeHH < 10) ? '0' : '') + timeHH + ':' + ((timeMM < 10) ? '0' : '') + timeMM + ':' + ((timeSS < 10) ? '0' : '') + timeSS + '.' + timeSSm if (this.output) { this.output.value = timeString } else { self.status = timeString } } function buttons (name, output, interval, increment, bounce, offset) { // Initialize with default values this.name = name this.output = null this.interval = 1000 this.increment = 1 this.bounce = 1 this.offset = 0 this.timeout = null this.syncCount = 0 this.syncName = new array () this.syncInterval = new array () this.syncCountdown = new array () // Define object methods this.update = buttonsUpdate this.start = timerAppStart this.stop = timerAppStop this.toggle = timerAppToggle this.loop = timerAppLoop this.setOutput = timerAppSetOutput this.setInterval = timerAppSetInterval this.sync = timerAppSync this.unsync = timerAppUnsync this.setIncrement = timerAppSetIncrement this.setBounce = timerAppSetBounce this.setOffset = timerAppSetOffset // Initialize with specified values this.setOutput (output) this.setInterval (interval) this.setIncrement (increment) this.setBounce (bounce) this.setOffset (offset) this.start() } function buttonsUpdate () { if (this.output) { var newOffset = this.offset + this.increment if ((newOffset < this.output.length) && (newOffset >= 0)) { this.offset = newOffset } else { this.increment *= this.bounce if (this.increment >= 0) { this.increment = modRange (this.increment, 0, this.output.length-1) } else { this.increment = 0 - modRange (Math.abs (this.increment), 0, this.output.length-1) } this.offset += this.increment this.offset = modRange (this.offset, 0, this.output.length-1) } this.output[this.offset].checked = true } } // -- End Hiding Here --> </script> </head> <body onLoad='wClock = new clock ("wClock", document.clock.display); wButtons = new buttons ("wButtons", document.imastudios.buttons, 500, 1,-1); wButtons.stop(); wClock.sync ("wButtons", 1)'onUnload='wClock.stop(); wButtons.stop()'> <br> <br> <center><font color=red face="隶书" size=6>时间跳动器</font></center> <br> <center> <table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0"> <tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面为效果显示区!</strong></font></td></tr> <tr><td align=center> <FORM NAME='clock' ACTION=''> <TABLE BORDER=2><TR><TD> <FONT SIZE=-2> <INPUT TYPE='text' NAME='display' SIZE=8 onFocus='wClock.toggle()' onMouseOver='self.status="Click here to turn on/off clock"; return true'> </FONT> </TD></TR></TABLE> </FORM> <FORM NAME='imastudios'> <P> <INPUT TYPE='radio' NAME='buttons'> Tick <INPUT TYPE='radio' NAME='buttons'> Tock <INPUT TYPE='radio' NAME='buttons'> Tick <INPUT TYPE='radio' NAME='buttons'> Tock <INPUT TYPE='radio' NAME='buttons'> Tick </FORM></td></tr></table></center> <br> <br> <center> <SCRIPT LANGUAGE="JavaScript"> <!-- hide function goHist(a) { history.go(a); } //--> </script></center> <br> <br> </body> </html>
提示:您可以先修改部分代码再运行
站内搜索
:
标题
内容
下一篇
带开关的表单时间显示
上一篇
日期输入控件
本栏目最新
栏目最新列表
符合标准的时间选择控件
js选择日期(可以选择开始结束时间)
带对勾的日期选择控件 蓝色
蓝色日历控件 只能选择日期
10秒倒计时的JS代码
网站优化策划
栏目最新列表
增加网站外链的快速方法
网站上线前必做的30个检查
新的友情链接参考标准(没有google的PR情况
优化Google的AdSense广告的五个工具
王通讲SEO八大基础
站点最新
站点最新列表
微博推广的一些技巧
xhEditor v1.1.7 发布,
收集的一些轻量级非常实
50个新鲜兼容最新版本的
javascript中cookie的设
Excel中出现#VALUE!、#D
jquery插件:飞飞表情插件
十个使用HTML5开发的精彩
支持HTML5的浏览器有哪些
飞妮莫属:漫画:如何写出
历史最热10条信息
MIME介绍 及
[
1
] [
2
] [
3
]
巧用Google和迅雷来下载
Transact SQL 常
[
1
] [
2
]
VIA Rhine II Fast Ethe
电脑常用端
[
1
] [
2
] [
3
]
Do you get a kick out
十道羊皮卷 欣赏+mp3版+
每日一句:A friend and
每日一句:Theres no tu
经典__悟透JavaScript
伟哥博客
西安房产
123最新电影
三四六四
关于站点
|
免责声明
|
联系站长
|
网站地图
|
陕ICP备07002804号
WEB技术QQ交流群:72840059
©2007 ffasp.com. 版权所有