js时间显示样式源代码
来源:互联网 发布:php好书推荐 编辑:程序博客网 时间:2024/06/10 01:18
<!DOCTYPE html>
<html>
<head>
<title>hl.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<!-- 把如下代码加入<head>区域中 -->
<script LANGUAGE="javascript" TYPE="text/javascript">
//这里面设置相关样式,注意不要错删标点哦
function style() {
document
.write('<table border="1" cellspacing="0" cellpadding="1" align="CENTER" bgcolor="pink"><TR><TD><table border="1" cellspacing="1" cellpadding="1" bgcolor="pink">');
document.writeln("</TR><TR>");
document
.writeln('<TR><td colspan="7" align="CENTER" valign="TOP" bgcolor="red"><form name="clock"><FONT style=font-size:9pt;Color:#ffffff>当前时间 <INPUT TYPE="Text" NAME="face" size="12" ALIGN="TOP"></FONT></TD></TR></TABLE></TD></TR></TABLE></form>');
}
</script>
<script LANGUAGE="javascript">
//这里主要是控制时间
var timerID = null;
var timerRunning = false;
function stopclock() {
if (timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timevalue = " " + ((hours > 12) ? hours - 12 : hours);
timevalue += ((minutes < 10) ? ":0" : ":") + minutes;
timevalue += ((seconds < 10) ? ":0" : ":") + seconds;
timevalue += (hours >= 12) ? " PM" : " AM";
document.clock.face.value = timevalue;
timerID = setTimeout("showtime()", 1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
</script>
<!-- 在窗体加载的时候调用startclock()函数 -->
<body onLoad="startclock()">
<!-- 调用style显示样式 -->
<script LANGUAGE="javascript" TYPE="text/javascript">
style();
</script>
</body>
</html>
- js时间显示样式源代码
- php显示动态时间源代码
- 显示时间js
- 时间显示js
- js显示时间
- JS显示动态时间
- js动态显示时间
- js显示时间
- js 状态栏显示时间
- JS时间显示
- JS显示时间
- js时间显示
- js 动态显示时间
- js 简单时间显示
- js显示动态时间
- JS显示时间
- js -显示时间
- js显示当前时间
- SpringMVC注解说明
- cocos2d-x学习笔记(20)-- box2d入门
- URL重写(使用微软URLRewriter)
- 5月份比赛作品《无线视频小车》
- Spring3.1+SpringMVC3.1+JPA2.0
- js时间显示样式源代码
- SQL Query to get Oracle Menus & Functions .
- Global Variable in PL/SQL .
- MySql存储过程—游标(Cursor)
- SpringMVC+Apache Shiro+JPA(hibernate)案例教学(一)整合配置
- UVa 568 Just the Facts
- ofbiz jobsandbox自我记录
- android hover监控鼠标移动事件
- EXTJS gridpanel中的checkbox列 根据数据库值 来初始化是否被选