Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <head>
  2. <title>Analog Clock</title>
  3. <script type="text/javascript" src="script.js"></script>
  4. <link type="text/css" rel="stylesheet" href="style.css">
  5. </head>
  6.  
  7. <svg width="140" height="140">
  8. <circle id="clock-face" cx="70" cy="70" r="65" />
  9. <line id="h-hand" x1="70" y1="70" x2="70" y2="38" />
  10. <line id="m-hand" x1="70" y1="70" x2="70" y2="20" />
  11. <line id="s-hand" x1="70" y1="70" x2="70" y2="12" />
  12. <line id="s-tail" x1="70" y1="70" x2="70" y2="56" />
  13. <text x="62" y="18">12</text>
  14. <text x="126" y="76">3</text>
  15. <text x="66" y="130">6</text>
  16. <text x="7" y="76">9</text>
  17. </svg>
  18.  
  19. function setAttr(id, value) {
  20. var v = 'rotate(' + val + ',200,200);';
  21. document.getElementById(id).setAttribute('transform', v);
  22. };
  23. setAttr('s-hand', 30);
  24.  
  25. <script src="clockwork.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement