<%@ page language="java" import="java.util.*" 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">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'test.jsp' starting page
</title>
<script type="text/javascript" src="js/jquery.js"></script>
<style type="text/css">
#loading{
position:fixed;
right:50%;
bottom:50%;
z-index:1000;
display: none;
}
#stop{
display: none;
}
</style>
<script type="text/javascript">
function openWin(){
document.getElementById( 'loading' ).style.display = 'block';
document.getElementById( 'start' ).style.display = 'none';
document.getElementById( 'stop' ).style.display = 'block';
}
function closeWin(){
document.getElementById( 'loading' ).style.display = 'none';
document.getElementById( 'stop' ).style.display = 'none';
document.getElementById( 'start' ).style.display = 'block';
}
function openWin2(){
document.getElementById( 'loading' ).style.display = 'block';
setTimeout( closeWin2, 5000 );
}
function closeWin2(){
document.getElementById( 'loading' ).style.display = 'none';
}
</script>
</head>
<body>
<div id="loading"><img src="images/loading.gif"/></div>
<input id="start" type="button" value="开始加载" onclick="openWin()"/>
<input id="stop" type="button" value="结束加载" onclick="closeWin()"/><br/>
<input id="end" type="button" value="开始加载,5秒结束" onclick="openWin2()"/>
</body>
</html>
转载请注明原文地址: https://www.6miu.com/read-4018.html