js 进度条代码
2010-05-14 15:30
232 查看
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>loading</title>
</head>
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}
#barbackground{
background-color:black;
}
-->
</style>
<script language="JavaScript1.2">
var duration=5
function postaction(){
document.all.baranchor.style.visibility="hidden"
document.all.percent.style.visibility="hidden"
document.location.href="http://www.tom.com"
}
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
{
clipright=clipright+(widthIE/(duration*20));
document.all.percent.innerHTML="<center><font color=red>"+clipright/2 + "%</font></center>"
}
else{
window.status='成功登入'
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</script>
<body>
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;left:300;top:150;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
document.write('<div id="percent" style="position:relative;width:200px;height:20px;visibility:visible;left:390;top:150"></div>')
}
</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>loading</title>
</head>
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}
#barbackground{
background-color:black;
}
-->
</style>
<script language="JavaScript1.2">
var duration=5
function postaction(){
document.all.baranchor.style.visibility="hidden"
document.all.percent.style.visibility="hidden"
document.location.href="http://www.tom.com"
}
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
{
clipright=clipright+(widthIE/(duration*20));
document.all.percent.innerHTML="<center><font color=red>"+clipright/2 + "%</font></center>"
}
else{
window.status='成功登入'
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</script>
<body>
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;left:300;top:150;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
document.write('<div id="percent" style="position:relative;width:200px;height:20px;visibility:visible;left:390;top:150"></div>')
}
</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
</body>
</html>
相关文章推荐
- Spring Boot+AngularJS+BootStrap实现进度条示例代码
- 原生JS上传大文件显示进度条 php上传文件代码
- js 进度条,代码实现
- js代码格式化工具(简单格式化,显示进度条)
- PHP + plupload.js实现多图上传并显示进度条加删除实例代码
- 预加载css或javascript的js代码
- 这段js代码得拯救你多少时间
- Atom编辑器折腾记_(15)JS代码片段补全(插件:javascript-snippets)
- jS静态分页代码
- JS判断不同分辨率调用不同的CSS样式文件实现思路及测试代码
- js编码规范:使用JSDoc建立JavaScript代码的文档
- js Flash插入函数免激活代码
- JS 通过系统时间限定动态添加 select option的实例代码
- RxJS的另外四种实现方式(一)——代码最小的库
- js 密码强度验证规则、打分、验证代码
- JS实现星星评分功能实例代码(两种方法)
- Native.js屏幕截图实例代码
- js读写json文件实例代码
- JS实现的网页背景闪电闪烁效果代码
- 基于Js实现的UrlEncode和UrlDecode函数代码