×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Javascript
Posted by: Vlad Krasovsky
Added: Oct 22, 2014 10:10 PM
Views: 13
Tags: no tags
фыв
  1. $(document).ready(function () {
  2.         var timeStr = timeConverter.dateTime();
  3.    
  4.     setInterval(function () {  
  5.         var seconds = timeConverter.dateTime().second();
  6.         minSum = Math.floor(seconds/60);
  7.         var sdegree = seconds * 6;
  8.         var srotate = "rotate(" + sdegree + "deg)";
  9.  
  10.         $("#sec").css({"-moz-transform": srotate, "-webkit-transform": srotate});
  11.         //secSum++;
  12.  
  13.     }, 1000);
  14.  
  15.     setInterval(function () {
  16.         var hours = timeConverter.dateTime().hour();
  17.         var mins = timeConverter.dateTime().minute();
  18.         hourSum = Math.floor(mins/60);
  19.         var hdegree = hours * 30 + (mins / 2);
  20.         var hrotate = "rotate(" + hdegree + "deg)";
  21.  
  22.         $("#hour").css({"-moz-transform": hrotate, "-webkit-transform": hrotate});
  23.  
  24.     }, 1000);
  25.  
  26.  
  27.     setInterval(function () {
  28.         var mins = timeConverter.dateTime().minute();
  29.         var mdegree = mins * 6;
  30.        
  31.         var mrotate = "rotate(" + mdegree + "deg)";
  32.  
  33.         $("#min").css({"-moz-transform": mrotate, "-webkit-transform": mrotate});
  34.  
  35.     }, 1000);
  36.  
  37. });
  38.