📄 top.jsp
字号:
<%@ page contentType="text/html; charset=GBK" language="java"
import="java.sql.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.sql.Time"%>
<html>
<head>
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-image: url(../images/top.PNG);
background-repeat: no-repeat;
margin-left: 0px;
margin-top: 0px;
}
-->
</style>
</head>
<script language="javascript">
function ShowDate(Elements)
{
var temp;
var datetime = new Date();
var year = datetime.getYear();
var month = datetime.getMonth() + 1;
var date = datetime.getDate();
var day = datetime.getDay();
temp = year+"年"+month+"月"+date+"日 ";
switch (day)
{
case 0:
temp = temp+"星期日";
break;
case 1:
temp = temp+"星期一";
break;
case 2:
temp = temp+"星期二";
break;
case 3:
temp = temp+"星期三";
break;
case 4:
temp = temp+"星期四";
break;
case 5:
temp = temp+"星期五";
break;
case 6:
temp = temp+"星期六";
break;
}
Elements.innerHTML = temp;
}
function ShowTime(Elements)
{
var temp = "";
var datetime = new Date();
var hour = datetime.getHours();
var minu = datetime.getMinutes();
var seco = datetime.getSeconds();
if(hour < 10)
hour ="0" + hour;
if(minu < 10)
minu ="0" + minu;
if(seco < 10)
seco ="0" + seco;
temp = temp+" "+hour+":"+minu+":"+seco+" ";
if(hour >= 0 && hour < 5)
temp = temp + "零晨好"
if(hour >= 5 && hour < 8)
temp = temp + "早上好"
if(hour >= 8 && hour < 11)
temp = temp + "上午好"
if(hour >= 11 && hour < 13)
temp = temp + "中午好"
if(hour >= 13 && hour < 17)
temp = temp + "下午好"
if(hour >= 17 && hour < 24)
temp = temp + "晚上好"
Elements.innerHTML = temp; //这个Elements代表(表格)的id
window.setTimeout("ShowTime(" + Elements.id + ")",1000) //这里Elements.name或Elements.id不是Elements
}
</script>
<body >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="he">
</td>
</tr>
<tr>
<td align="center" class="he">
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="2%" height="23" align="left" valign="top" class="white">
</td>
<td align="left" valign="top" class="white">
</td>
<td width="57%" align="center" valign="top" class="white">
</td>
<td align="right" valign="top" class="white">
</td>
</tr>
<tr>
<td width="2%" height="23" align="left" valign="top" class="white">
</td>
<td align="left" valign="top" class="white">
</td>
<td width="57%" align="center" valign="top" class="white" style="font-weight: bold;">
<marquee direction="left" scrollamount="1">
<img src="../images/dog.gif" width="19" height="18">
<font color="#feab10">你好!欢迎你的光临</font>
</marquee>
</td>
<td align="right" valign="top" class="white">
</td>
</tr>
<tr>
<td height="23" align="left" valign="top" class="white">
</td>
<td width="16%" align="left" valign="top" class="white" style="font-weight: bold;">
员工:${username}
</td>
<td align="center" valign="top" class="white" >
</td>
<td width="25%" align="right" valign="top" class="white" id="time" style="font-weight: bold;">
<script>ShowTime(time);</script>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -