以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  效果不错的数字时钟  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=9586)


--  作者:卷积内核
--  发布时间:8/27/2004 9:28:00 AM

--  效果不错的数字时钟
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
  <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
]>
<!-- SVG - Learning By Coding - http://www.datenverdrahten.de/svglbc/ -->
<!--    Author: Dr. Thomas Meinike 02/03 - thomas@handmadecode.de     -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
  onload="Datum_Uhrzeit()">
  <title>SVG - Learning By Coding</title>
  <desc>SVG-Spezifikation in Beispielen</desc>
  <defs>
    <style type="text/css">
      <![CDATA[
      text
      {
        font-family: SimSun;
        font-weight: bold;
      }
      text.t1
      {
        fill: #F00;
        font-size: 24px;
      }
      text.t2
      {
        fill: #090;
        font-size: 36px;
      }
      text.headline
      {
        font-family: sans-serif;
        font-size: 24px;
        font-weight: normal;
        fill: #0EC;
      }
    ]]>
    </style>
    <script type="text/javascript">
      <![CDATA[
      var svgroot,text1,text2;
      svgroot=document.documentElement;
      text1=svgroot.getElementById("datum");
      text2=svgroot.getElementById("zeit");
      function Datum_Uhrzeit()
      {
        var datumzeit,temp,datum,zeit;
        datumzeit=new Date().toLocaleString();
        temp=datumzeit.lastIndexOf(" ");
        datum=datumzeit.substring(0,temp);
        zeit=datumzeit.substring(temp+1,datumzeit.length);
        text1.firstChild.data=datum;
        text2.firstChild.data=zeit;
        setTimeout("Datum_Uhrzeit()",1000);
      }
      ]]>
    </script>
  </defs>
  <text class="headline" x="100" y="130">SVG Digital Clock</text>
  <text id="datum" class="t1" x="100" y="180"> </text>
  <text id="zeit" class="t2" x="100" y="220"> </text>
</svg>
--  作者:SCYANGYU
--  发布时间:2/18/2005 11:22:00 AM

--  
脚本有些问题,不能正常运行!
--  作者:SCYANGYU
--  发布时间:2/24/2005 3:42:00 PM

--  
我调了调,现在可以了。

---------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
  <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
  onload="yy_datetime()">
  <title>SVG - Learning By Coding</title>
  <desc>SVG-Spezifikation in Beispielen</desc>
  <defs>

    <style type="text/css">
      <![CDATA[
      text
      {
        font-family: monospace;
        font-weight: bold;
      }
      text.t1
      {
        fill: #F00;
        font-size: 24px;
      }
      text.t2
      {
        fill: #090;
        font-size: 36px;
      }
      text.headline
      {
        font-family: sans-serif;
        font-size: 24px;
        font-weight: normal;
        fill: #000;
      }
    ]]>
    </style>
   <script type="text/javascript">
      <![CDATA[
      var svgroot,text1,text2;
      svgroot=document.documentElement;
      text1=svgroot.getElementById("date");
      text2=svgroot.getElementById("time");
      function yy_datetime()
      {
        var datetime,temp,date,time;
        datetime=new Date().toLocaleString();
        temp=datetime.lastIndexOf(" ");
        date=datetime.substring(0,temp);
        time=datetime.substring(temp+1,datetime.length);
        text1.firstChild.data=date;
        text2.firstChild.data=time;
        setTimeout("yy_datetime()",1000);
      }
      ]]>
    </script>
  </defs>
  <text class="headline" x="20" y="30">SVG Digital Clock</text>
  <text id="date" class="t1" x="20" y="80"> </text>
  <text id="time" class="t2" x="20" y="120"> </text>
</svg>


--  作者:_phoenix
--  发布时间:4/12/2005 11:42:00 PM

--  
领用了,谢谢.
--  作者:henrybenben
--  发布时间:4/13/2005 9:33:00 PM

--  
学习中,谢谢俄i!
--  作者:zhufeng
--  发布时间:4/22/2005 1:02:00 AM

--  
good!
--  作者:keeponline
--  发布时间:4/22/2005 12:10:00 PM

--  
普通
--  作者:zzzzzz2
--  发布时间:5/11/2005 1:06:00 PM

--  
好是好,但是我这里中文显示有点问题~~乱码,就是那个toLocalString()得到的中文。

自己解决了。


--  作者:suming
--  发布时间:5/13/2005 4:37:00 PM

--  
偶也出现问题了。
--  作者:zhouzb2001
--  发布时间:7/16/2005 9:18:00 AM

--  
出现提示 对象不支持此属性或方法
是怎么回事?
--  作者:qtsh
--  发布时间:8/13/2005 10:32:00 AM

--  
谢谢版主!
--  作者:hjx_221
--  发布时间:8/15/2005 11:08:00 AM

--  
学习中,谢谢俄i!
--  作者:jf3jf
--  发布时间:9/14/2005 3:49:00 PM

--  
谢谢最好是在多发一些
--  作者:wanghai00
--  发布时间:10/1/2005 11:32:00 AM

--  
谢谢
--  作者:L_Dalong
--  发布时间:10/3/2005 4:38:00 PM

--  
为什么我这出现如下错误信息:Mircosoft JScript 运行时错误:对象不支持此属性或方法。
text1.firstchild  为空或不是对象。
请指教,怎么样解决阿。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
109.375ms