html在状态栏中显示时间,html网页时间显示代码和倒计时代码大全
Date();
var day; var date;
if(today.getDay()==0) day
= "星期日"
if(today.getDay()==1) day
= "星期一"
if(today.getDay()==2) day
= "星期二"
if(today.getDay()==3) day
= "星期三"
if(today.getDay()==4) day
= "星期四"
if(today.getDay()==5) day
= "星期五"
if(today.getDay()==6) day
= "星期六"
document.fgColor = " cadet";
date1 = "
color=0000ff>" + (today.getYear()) + "年" +
(today.getMonth() + 1 ) + "月" + today.getDate() + "日 " +
"
";
date2 = "
color=ff0000>" + day +
"
";
document.write("
"
+ date1.fontsize(2) + date2.fontsize(2) +
"
");
align=center>
id=liveclock 15px? height: 109px;
style?="width:">
size=5>17:47:26
function www_helpor_net()
{
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
if(minutes<=9)
minutes="0"+minutes
if(seconds<=9)
seconds="0"+seconds
myclock="
color=0000ff>"+hours+":"+minutes+":"+seconds+"
"
if(document.layers){document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}else if(document.all)
liveclock.innerHTML=myclock
setTimeout("www_helpor_net()",1000)
}
www_helpor_net();
//-->
中文显示的时候保存为.js文件再用网页调用出现乱码。用uft-8编码保存.js文件即可解决乱码问题。
---------------------------------------------------------分割线-----------------------------------------------------
实时游走的数字时钟
function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = xfile+hours+minutes+seconds;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
第1步.将下面的代码加入html文件任意需要的地方
align="center" style="font-size: 20;
color:#000000">
你可以自行更改样式!
---------------------------------------------------------分割线-----------------------------------------------------
显示年月日格式的时间代码
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"
style='font-size:9pt;font-family: 宋体'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日",
d[today.getDay()+1],
"
" );
---------------------------------------------------------分割线-----------------------------------------------------
显示日期,星期,时间格式的代码
---------------------------------------------------------分割线-----------------------------------------------------
显示来访者的停留时间
var ap_name = navigator.appName;
var ap_vinfo = navigator.appVersion;
var ap_ver =
parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));
var time_start = new Date();
var clock_start = time_start.getTime();
var dl_ok=false;
function init ()
{
if(ap_name=="Netscape" &&
ap_ver>=3.0)
dl_ok=true;
return true;
}
function get_time_spent ()
{
var time_now = new Date();
return((time_now.getTime() - clock_start)/1000);
}
function show_secs () // show the time
user spent on the side
{
var i_total_secs = Math.round(get_time_spent());
var i_secs_spent = i_total_secs % 60;
var i_mins_spent = Math.round((i_total_secs-30)/60);
var s_secs_spent = "" + ((i_secs_spent>9) ?
i_secs_spent : "0" + i_secs_spent);
var s_mins_spent = "" + ((i_mins_spent>9) ?
i_mins_spent : "0" + i_mins_spent);
document.fm0.time_spent.value = s_mins_spent + ":" +
s_secs_spent;
window.setTimeout('show_secs()',1000);
}
// -->
onSubmit="0">
COLOR="#6060FF">停留时间:
type="text" name="time_spent" size=7
onFocus="this.blur()">
第二步:在你主页源文件
中加入下面代码的兰色部分
---------------------------------------------------------分割线-----------------------------------------------------
显示当前日期与时间的格式
---------------------------------------------------------分割线-----------------------------------------------------
浏览器状态栏显示的时钟
---------------------------------------------------------分割线-----------------------------------------------------
显示最后更新时间代码
---------------------------------------------------------分割线-----------------------------------------------------
实时走动的数字时钟
function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = xfile+hours+minutes+seconds;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
style="font-size: 20;
color:#000000">
---------------------------------------------------------分割线-----------------------------------------------------
根据不同的时间显示不同的问候语
方法:在主页中你需要的地方加入以下代码:
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("明天不用上班了吗?")}
else if (hour < 8){document.write("全新的一天!")}
else if (hour < 12){document.write("早安!")}
else if (hour < 14){document.write("外面太阳大吗?")}
else if (hour < 18){document.write("午安!")}
else if (hour < 22){document.write("晚上好!")}
else if (hour < 24){document.write("夜深了! 要注意身体呀!
祝你做个好梦!")}
// -->
说明,可以自行修改出更好更多的问候语!
---------------------------------------------------------分割线-----------------------------------------------------
一个很酷的透明时钟代码
方法:在页面中你需要的地方加入下面的代码
BODY {COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt;
LINE-HEIGHT: 13pt}
TD {COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; LINE-HEIGHT:
13pt}
A:visited {COLOR: #000080;text-decoration:none}
a:link { text-decoration:none }
a:hover { text-decoration:underline }
.f12 {font-size:12px;}
.f13 {font-size:14.9px; LINE-HEIGHT: 120%}
.f24 {font-size:24px;LINE-HEIGHT: 120%}
.f14 {font-size:14.9px; LINE-HEIGHT: 170%}
Zp=670;H='....';H=H.split('');M='.....';M=M.split('');S='......';S=S.split('');Yp=0;Xp=0;Yb=8;Xb=8;d_=12;
ns=(document.layers)?1:0;fCol='222222';sCol='ff0000';mCol='0000ee';hCol='green';if
(ns){dgts='1 2 3 4 5 6 7 8 9 10 11 12';
dgts=dgts.split(' ');for
(i=0;i
name=nsDigits'+i+' top=0 left=0 height=30
width=30>
face=Arial,Verdana size=1
color='+fCol+'>'+dgts[i]+'
');}for
(i=0;i
{document.write('
name=ny'+i+' top=0 left=0 bgcolor='+mCol+'
clip="0,0,2,2">
');}for
(i=0;i
{document.write('
name=nz'+i+' top=0 left=0 bgcolor='+hCol+'
clip="0,0,2,2">
');}for
(i=0;i
{document.write('
name=nx'+i+' top=0 left=0 bgcolor='+sCol+'
clip="0,0,2,2">
');}}else{document.write('
style="position:absolute;top:0px;left:0px">
style="position:relative">');for
(i=1;i
('
style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial,Verdana;font-size:
10px;color:'+fCol+';text-align:center;padding-top:10px">'+i+'
');}document.write('
');document.write
('
style="position:absolute;top:0px;left:0px">
style="position:relative">');for
(i=0;i
('
style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'">
');}document.write('
');document.write('
');document.write('
html在状态栏中显示时间,html网页时间显示代码和倒计时代码大全相关推荐
- 网络 计算机不显示不出来,网页图片显示不出来怎么办 网络故障解决【详解】...
网页图片显示不出来怎么办? 文字与图片是构成一个网页的两个最基本的元素.你可以简单地理解为:文字,就是网页的内容.图片,就是网页的美观.除此之外,网页的元素还包括动画.音乐.程序等等. 有时候我们浏览 ...
- obj模型在html页面显示,如何在网页上显示3D模型?
回答: 1. Word自动转换布局的功能其实并不是很好,往往造成与Word内的布局错乱的情况.让很多本来费了很多心思设计Word布局的人非常恼火.对于这种问题,我采用了现在Word内设计表格布局的方法 ...
- html英文日期js,JS网页上显示中英文版日期时间(根据电脑上的时间)
JS网页上显示中英文版日期时间(根据电脑上的时间) <script language="javascript"> function shownowtime() { va ...
- iPhone状态栏中为什么时间显示为蓝色图标
当iPhone左上角的时间以蓝色气泡显示时,表示您的iPhone正在提供个人热点.进行屏幕镜像,或某个App当前正在使用您的位置信息. 管理个人热点:打开iPhone设置-个人热点,可设置是否允许其他 ...
- [VB]在状态栏中显示帮助信息
状态栏是VB中的一个很有用的控件,但是默认状态下它不在控件面板中,在我们使用它之前必须先添加,方法是按下Ctrl+T快捷键,在弹出的"Components"对话框中选中MS Win ...
- html中加入emjio表情,html网页上显示emoji表情
前言 做项目涉及表情在网页上显示.稍微研究了一下实现方案,整体思路不复杂,就是稍微涉及到一些新概念和新方法. 精灵图 精灵图又称雪碧图,简单来说就是一种把很多小图片拼成一张大图的图片形式.下图就是表情 ...
- html图片5秒后消失,如何让网页中图片等待5秒再显示_html/css_WEB-ITnose
如何让网页中图片等待5秒再显示. 网页打开的时候,网页中的图片就会马上显示.如何让某一个图片,在网页打开后5秒在显示出来. 回复讨论(解决方案) 1. 图片载入有判别事件,在事件中设置图片对象的显示隐 ...
- html语言显示动态当前日期和时间,举一反三 浅谈在网页上显示日期的两种方法-网页设计,HTML/CSS...
在上网的时候,经常会在一些网页上看到当前的日期,如:"今天是×年×月×日星期×"等字样.为了显示系统当前的日期,一般采用脚本语言vbscript或javascript,两种语言有其 ...
- Android 10.0状态栏居中显示时间和修改时间显示样式
1.概述 状态栏系统时间默认显示在左边和通知显示在一起,但是客户想修改显示位置,想显示在中间,所以就要修改SystemUI 的Clock.java 文件这个就是管理显示时间的,居中显示的话就得修改布局 ...
最新文章
- 0与1c语言编译,C语言程序设计(07776-1)第11章编译预处理课案.ppt
- 以上帝模式管理Windows系统
- 事件ID 6038审核NTLM使用情况
- ubuntu8.10家庭使用(一)
- Jupidator 0.8.0 发布,Java 应用自动更新框架
- 【学亮IT手记】HashMap集合精讲
- Python基础day02 作业解析【6道 if 判断题、9道 循环题】
- javascript-引入-函数的定义与使用-多值传参-ao对象
- LeetCode 646. 最长数对链
- 雪亮工程视频监控应用系统解决方案
- python截图搜题_用python的OCR实现自动截图搜题
- 大数据分析案例:财政收入预测分析
- 适合初学者使用的Mac绘图软件推荐
- 通过财务报表读懂美股
- Gazebo models / Gazebo Error [Node.cc:90] No namespace found
- 【每日力扣10】有效的数独
- 心形代码HTML,赶紧发给你喜欢的人
- 1.5 深入理解常见类
- 郭敬明最经典的45句话
- 企业如何选择合适的CDN加速服务?
热门文章
- 有趣,机器人吵架视频!
- 用心推荐三个嵌入式方向精品号
- vivado不识别HLS生成的IP解决方法
- 电路常识性概念(2)-电容
- java web mysql视图_Javaweb项目-下拉列表显示后台数据库的数据
- 计算机检索高考投档线,投档分数线是什么意思 2018各大学投档线是多少
- 湖南计算机专业专科排名2015,湖南最好的公办专科大学有哪些排名揭秘?湖南十大专科学校推荐?...
- cad图框尺寸标准图_工程必备 | CAD图纸1:100打印可以量取的尺寸
- python爬贴吧回复内容_Python 基础语法+简单地爬取百度贴吧内容
- Spring------自动化装配Bean(一)