js进度条实例
来源:互联网 发布:真丝睡衣品牌 知乎 编辑:程序博客网 时间:2024/05/01 20:21
jsp页面代码:test.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!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>Insert title here</title>
<base href="<%=basePath%>">
<script type="text/javascript" src="<%=basePath%>js/loading.js"></script>
</head>
<body>
<input type="button" name="Button" value="Button" onclick="Loading('loading', '<%=basePath%>js/', 80, 80)">
<div id="loading_div" ></div>
</body>
</html>
js代码:loading.js
//频率
var frequency = 50;
//步长
var step = 3;
//背景颜色
var loadingBgcolor = "#FFFFEC";
//宽度
var loadingWidth = 354;
/*
*参数说明:
*content:显示内容,可以为空;
*imageURL:将引用JS文件的路径设置即可;
*left:进度条显示位置left
*top:进度条显示位置top
*/
function Loading(content, imageURL, left, top)
{
imageURL = imageURL + "Loading.jpg";
LoadTable(content, imageURL, left, top);
showimage.style.display="";
window.setInterval("RefAct();", frequency);
}
function RefAct()
{
imgAct.width += step;
if(imgAct.width > loadingWidth-4)
{
imgAct.width = 0;
}
}
function LoadTable(content, imageURL, left, top)
{
var strLoading;
strLoading = "";
strLoading += "<div id=\"showimage\" style=\"DISPLAY:none;Z-INDEX:100;LEFT:" + left+ "px;POSITION:absolute;TOP:" + top+ "px;\" align=\"center\">";
strLoading += "<TABLE id=\"Table1\" cellSpacing=\"0\" cellPadding=\"0\" width=\"" + loadingWidth + "\" border=\"0\" bgcolor=\"" + loadingBgcolor+ "\">";
if(content != "")
{
strLoading += "<tr>";
strLoading += "<td align=\"center\">";
strLoading += "<font size=\"4\" face=\"Courier New, Courier, mono\"><strong>" + content + "</strong></font>";
strLoading += "</td>";
strLoading += "</tr>";
strLoading += "<TR>";
}
strLoading += "<TD class=\"Loading\" height=\"8\">";
strLoading += "<IMG id=\"imgAct\" height=\"8\" alt=\"\" src=\"" + imageURL + "\" width=\"0\">";
strLoading += "</TD>";
strLoading += "</TR>";
strLoading += "</TABLE>";
strLoading += "</div>";
document.getElementById("loading_div").innerHTML = strLoading;
}
- js进度条实例
- 进度条实例
- 进度条实例
- 每日一个js实例6--通过面向对象实现进度条
- js进度条
- 进度条js
- js进度条
- js进度条
- js进度条。
- js进度条
- 进度条js
- js 进度条
- JS进度条
- js 进度条
- js进度条
- jS进度条
- js进度条
- JS-----------------进度条
- (心境)程序员都应该挖一口属于自己的井
- 学习资料分享——java视频教程及电子书免费下载
- 三步搞定ubuntu网络设置
- Json 与IList 、DataSet 以及实例类对象之间的互转
- SQLite Transactions
- js进度条实例
- 为Android加入busybox工具
- 百叶窗式面板组
- C语言学习笔记(3)
- vim 移动: 行
- 真彩位图工具栏的实现
- JS解析json数据(如何将json字符串转化为数组)
- 制作带弹出式菜单的按钮
- 重装Oracle时提示“指定的SID在本机上已经存在”解决方案