html
来源:互联网 发布:2016nba总决赛数据统计 编辑:程序博客网 时间:2024/06/05 14:46
三句标准的Dynamic Html 创建进度条
<HTML>
<HEAD>
<TITLE>Recalc Example</TITLE>
<STYLE>
BUTTON {font-size:14;width:150}
</STYLE>
<SCRIPT>
var timerID = null;
var seconds = 0;
//
// This function is called when the page loads.
// It sets up a couple of expressions.
//
function init()
{
A.style.setExpression("width","seconds*10");
B.setExpression("innerText","seconds.toString()");
}
//
// This function gets calls once a second and updates the seconds
// variable. Notice that withoutrecalc, the expressions aren't
// updated until the mouse is moved.
//
function timer()
{
seconds++;
document.recalc();
}
//
// starts the timer
//
function starttimer()
{
if (timerID == null)
{
timerID = setInterval("timer()", 1000);
startButton.disabled = true;
stopButton.disabled = false;
}
}
//
// stops the timer
//
function stoptimer()
{
if (timerID != null)
{
clearInterval(timerID);
timerID = null;
startButton.disabled = false;
stopButton.disabled = true;
}
}
//
// resets the timer
//
function resettimer()
{
seconds = 0;
}
</SCRIPT>
</HEAD>
<BODY onload="init()">
<DIV id=A style="background-color:lightblue" ></DIV>
<DIV id=B style="color:hotpink;font-weight:bold"></DIV>
<BR>
<BUTTON id="startButton" onclick="starttimer()">Start the Timer</BUTTON></BR>
<BUTTON id="stopButton" DISABLED="true" onclick="stoptimer()">Stop the Timer</BUTTON><BR>
<BUTTON id="resetButton" onclick="resettimer()">Reset the Timer</BUTTON><BR>
<P style="width:320;color:peru;background-color:wheat">
This example illustrates the use of document.recalc(). If the calls
to recalc are omitted in this example, expressions will not be updated
until the mouse is moved.
</P>
</BODY>
</HTML>
- html
- html
- html
- HTML
- HTML
- html
- html
- html
- html
- HTML
- HTML
- Html
- html
- HTML
- html
- HTML
- HTML
- HTML
- 23种设计模式
- “21天教你学会C++”[来自CoolShell]
- html
- fread函数 和 feof函数
- Nutch 1.3 学习笔记3-1 Inject CrawlDB Reader
- html
- html
- 最近工作生活的总结
- TIME_WAIT 状态
- 在Windows上用QEMU仿真ARM系统
- Java 异常处理及其应用
- Qemu-ARM-Ubuntu 实验
- VPS独立服务器如何远程登录(windows和linux)
- 有名管道FIFO的一个客户端输出