鍍金池/ 教程/ HTML/ SVG時(shí)鐘
SVG鏈接
SVG陰影效果
SVG線性漸變
SVG文本
SVG平面陰影
SVG圖表
SVG交互
SVG時(shí)鐘
SVG漸變
SVG <pattern>元素
SVG簡(jiǎn)介
SVG徑向漸變
SVG <filter>元素
SVG對(duì)話框效果
SVG形狀
SVG stroke屬性
SVG圖形
SVG教程
SVG事件監(jiān)聽器
SVG加載器示例
SVG腳本(JavaScript)
SVG圖標(biāo)
SVG拖動(dòng)
SVG模糊效果

SVG時(shí)鐘

時(shí)鐘示例是基于clock.jssnap.svg.js來實(shí)現(xiàn)的。 樣品采集如下所示。

代碼實(shí)現(xiàn) -

<!DOCTYPE html>
<html>
<head>

  <script src="snap.svg-min.js"></script>
  <script src="clock.js"></script>
  <style>
    body { font-family: sans-serif;background-color: #46C2D4; }
    div { width: 300px; heigth: 350px; float: left; text-align: center; margin-bottom: 2em; }
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.2em; }
    p { font-size: 0.9em; }
    p.clear{ clear: left; }
  </style>
</head>
<body>

  <div>
  <svg id="clockUK" width="300" height="300" style="
    margin-left: 112px;
">

  </div>



<script>
  // Start clocks
  var uk = new Clock("clockUK");
  uk.startClock();

  var ukbounce = new Clock("clockUKBounce", { showSeconds: true, offset: 2, movement: "bounce" });
  ukbounce.startClock();

  var nyc = new Clock("clockNYC", -5);
  nyc.startClock();

  var clock = new Clock("clock", 21, 39);
  clock.hideSecondHand();
</script>
</body>
</html>

代碼下載:
https://www.yiibai.com/downloads/svg/clock.zip


上一篇:SVG平面陰影下一篇:SVG模糊效果