JS 时钟

<script language=javascript>
    function Year_Month(){
        var now = new Date();
        var yy = now.getFullYear();
        var mm = now.getMonth()+1;
        var cl = ‘<font color="#666666">‘;
        if (now.getDay() == 0) cl = ‘<font color="#666666">‘;
        if (now.getDay() == 6) cl = ‘<font color="#666666">‘;
        return(cl +  yy + ‘/‘ + mm + ‘</font>‘);
    }
    function Date_of_Today(){
        var now = new Date();
        var cl = ‘<font color="#666666">‘;
        if (now.getDay() == 0) cl = ‘<font color="#666666">‘;
        if (now.getDay() == 6) cl = ‘<font color="#666666">‘;
        return(cl +  now.getDate() + ‘</font>‘);
    }
    function Day_of_Today(){
        var day = new Array();
        day[0] = "周日";
        day[1] = "周一";
        day[2] = "周二";
        day[3] = "周三";
        day[4] = "周四";
        day[5] = "周五";
        day[6] = "周六";
        var now = new Date();
        var cl = ‘<font color="#666666">‘;
        if (now.getDay() == 0) cl = ‘<font color="#666666">‘;
        if (now.getDay() == 6) cl = ‘<font color="#666666">‘;
        return(cl +  day[now.getDay()] + ‘</font>‘);
    }
    function CurentTime(){
        var now = new Date();
        var hh = now.getHours();
        var mm = now.getMinutes();
        var ss = now.getTime() % 60000;
        ss = (ss - (ss % 1000)) / 1000;
        var clock = hh+‘:‘;
        if (mm < 10) clock += ‘0‘;
        clock += mm+‘:‘;
        if (ss < 10) clock += ‘0‘;
        clock += ss;
        return(clock);
    }
    function refreshCalendarClock(){
    document.all.calendarClock2.innerHTML = Date_of_Today();
    document.all.calendarClock3.innerHTML = Year_Month()+‘&nbsp;‘+Day_of_Today();
    document.all.calendarClock4.innerHTML = CurentTime();
    }
    document.write(‘<table border="0" cellpadding="0" cellspacing="1" width="180" bgcolor="#f8f8f8" height="135">‘);
    document.write(‘<tr><td width="100%" height="100%" align="center">‘);
    document.write(‘<table border="0" cellpadding="0" cellspacing="0" width="100%" hight="100%" bgcolor="#f8f8f8" height="60">‘);
    document.write(‘<tr><td align="center" width="100%" height="100%">‘);
    document.write(‘<font id="calendarClock2" style="font-family:Arial;font-size:54pt;Line-Height=100%"> </font><br>‘);
    document.write(‘<font id="calendarClock3" style="font-family:Arial;font-size:18pt;Line-Height=100%"> </font><br>‘);
    document.write(‘<font id="calendarClock4" style="color:#666666;font-family:Arial;font-size:18pt;Line-Height=100%"><b> </b></font>‘);
    document.write(‘</td></tr></table>‘);
    document.write(‘</td></tr></table>‘);
    setInterval(‘refreshCalendarClock()‘,1000);
</script>
时间: 2024-10-05 14:23:01

JS 时钟的相关文章

js时钟

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv = "content-type" content="text/html;charset=utf-8"/> &

js时钟显示

<script type="text/javascript"> onload=function(){ start(); clock = window.setInterval('start()',1000); btn = document.getElementById('btn'); btn.addEventListener('click',timeOut); btnTxt = btn.childNodes[0]; } function start(){ var date =

js 时钟特效

时钟特效 CreateTime--2018年2月24日15:11:23 Author:Marydon 实现方式:都是基于HTML5的canvas标签实现的 款式一 借助jQuery插件实现 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta name="

html css js 时钟 计时器

时钟 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title>    <script>      var _hmt = _hmt || [];      (function() {       var hm = document.createElement("script"

FlipClock.js时钟,计数,3D翻转插件

1.FlipClock.js能够自动定义计数,时钟的翻牌效果,调用简单,下面简单记录下用法 2.官网地址:http://www.flipclockjs.com/ 3.调用2个文件 <link href="/assets/css/flipclock.css" rel="stylesheet" type="text/css"> <script src="/assets/js/flipclock/flipclock.min.

css3和原生js时钟

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> div{ width:200px; height:200px; border-radius: 50%; border:1px solid #000; position: relative; mar

js时钟demo

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"><title>无标题文档</title><style type="text/css"> *{ margin:0; padding:0; font-size:40px; } .container{ position:relative; width:

JS时钟钟表

<!DOCTYPE html> <html>    <head>        <meta charset="utf-8" />        <title></title>        <style> .clock{                width: 600px;                height: 600px;                background: url(im

react.js 时钟组件

React是用于构建用户界面的 JavaScript 库,React 组件使用一个名为 render() 的方法, 接收数据作为输入,输出页面中对应展示的内容. React除了可以使用外部传入的数据以外 (通过 this.props 访问传入数据), 组件还可以拥有其内部的状态数据 (通过 this.state 访问状态数据). 当组件的状态数据改变时, 组件会调用 render() 方法重新渲染.效果图没用样式写一下,凑合着看吧! 实例模拟: <style> .list{ list-styl