您的位置:首页 > 编程语言

实现网页打开进度条的一小段代码

2011-06-15 23:22 204 查看
JS实现的。很简单。

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>进度条演示</title>
<mce:script type="text/javascript"><!--
window.onload=fun;
var bar_content="||";
var init_content="||";
var content=0;
function fun()
{
init_content=init_content+bar_content;
content+=2;
form1.bar1.value=init_content;
form1.text1.value=content+"%";
if(content<=99)
{
setTimeout("fun()",100);
}
else
{
window.location="index.jsp";
}
}
// --></mce:script>
</head>
<body>
<h1>进度条演示</h1><hr>
<p align="center">正在打开网页....</p>
<form name="form1">
<p align="center"><input size=46 name="bar1" style="color:gray;align:center;padding:0px;background-color:white;" mce_style="color:gray;align:center;padding:0px;background-color:white;"/></p>
<p align="center"><input size=46 name="text1" style="color:gray;text-align:center;" mce_style="color:gray;text-align:center;"/></p>
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  input fun html function java