易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript_基于JS的进度条

开发时,需要用到的JavaScript进度条~~~
<style type="text/css">
#out {
width:200px;
height:16px !important;
border:1px solid #5858D1;
text-align:center;
position:relative;
font-size:12px;
_height:18px;
}
#out, #out * {
padding:0;
margin:0;
}
#num {
height:16px;
line-height:16px;
position:absolute;
top:0;
left:90px;
z-index:1001;
}
#step {
background:#5858D1;
width:5%;
overflow:hidden;
position:absolute;
left:0;
top:0;
height:16px;
z-index:1000;
}
</style>
<div id="out">
<span id="num">5%</span>
<div id="step"></div>
</div>
<script type="text/javascript">
var timer;
var stepNum = 0;
function start()
{
timer = setInterval("begin()", 10);
}
function begin()
{
stepNum += 1;
if (stepNum < 101)
{
document.getElementById("step").style.width = stepNum + "%";
document.getElementById("num").innerHTML = stepNum + "%";
}
else
{
clearInterval(timer);
// 加载完了,该干嘛干嘛
//window.location = 'http://www.codebit.cn';
}
}
window.onload = function()
{
start();
}
</script>
<Br><br>
<span style="padding:0;margin:0;width:200px;height:16px !important;border:1px solid #5858D1;text-align:center;position:relative;font-size:12px;_height:18px;">
<span style="width:50px;height:16px;position:absolute;left:0;top:0;background:#5858D1;width:50%"></span>
</span>


相关文档:

JavaScript事件冒泡简介及应用



          
一、什么是事件冒泡
在一个对象上触发某类事件(比如单击onclick事件),如果此对象定义了此事件的处理程序,那么此事件就会调用这个处理程序,如果没有定义此事 件处理程序或者事件返回true,那么这个事件会向这个对象的父级对象传播,从里到外,直 ......

JavaScript中confirm,alert,prompt的用法

本文简要介绍JavaScript中confirm,alert,prompt的用法,希望大家学习过程中能得到一些启发。
window.confirm 参数就只有一个。显示提示框的信息。按确定,返回true;按取消返回false。
< SCRIPT> var bln = window.confirm("确定吗?"); alert(bln) < /SCRIPT> window.alert参数,只有一个,显示 ......

javascript with用法(转)

with
(object)
   statements
参数
object
新的默认对象。
statements
一个或多个语句,object 是该语句的默认对象。
说明
with
语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * ......

高效JavaScript 字符串替换函数的benchmark

版权声明
:可以任意转载,但转载时必须标明原作者charlee、原始链接http://tech.idv2.com/2006/11/23/javascript-strreplace-benchmark/
以及本声明。
感谢Clear为我们提供了这个效率更高的字符串替换函数
。这是经常使用的HTML特殊字符替换函数,即将 &、<、>、" 等函数替换成 &、<、>、&qu ......

IE和FireFox的兼容的javascript回车事件

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="serve ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号