Time Date

CSS3 Creative Round Pointer Clock jQuery Special Effect Code

 Alibaba Cloud

Code structure

  1.  < link  href = ' http://fonts.googleapis.com/css?family=Comfortaa:700 '  rel = 'stylesheet'  type = 'text/css' >
  2.  < script  type = "text/javascript"  src = "js/jquery-1.7.2.min.js" >< / script >
  3.  < div  id = "clock" >
  4.    < div  id = "hour"  style = "transform: rotate(56deg);" >< img  src = "hour.png" >< / div >
  5.    < div  id = "minute"  style = "transform: rotate(312deg);" >< img  src = "minute.png" >< / div >
  6.    < div  id = "second"  style = "transform: rotate(6deg);" >< img  src = "second.png" >< / div >
  7.  < / div >
  8.  < script  type = "text/javascript"  src = "js/jquery-1.7.2.min.js" >< / script > 
  9.  < script  type = "text/javascript" > function Clock_dg(prop) {
  10.  var angle = 360/60,
  11.  date = new Date();
  12.  var h = date.getHours();
  13.  if(h > 12) {
  14.  h = h - 12;
  15.  }
  16.  hour = h;
  17.  minute = date.getMinutes(),
  18.  second = date.getSeconds(),
  19.  hourAngle = (360/12) * hour + (360/(12*60)) * minute;
  20.  $('#minute')[0].style[prop] = 'rotate('+angle * minute+'deg)';
  21.  $('#second')[0].style[prop] = 'rotate('+angle * second+'deg)';
  22.  $('#hour')[0].style[prop] = 'rotate('+hourAngle+'deg)';
  23.  $('#clock').addClass('clock'+h);
  24.  }
  25.  $(function(){
  26.  var props = 'transform WebkitTransform MozTransform OTransform msTransform'.split(' '),
  27.  prop,
  28.  el = document.createElement('div');
  29.  for(var i = 0, l = props.length; i < l;  i++ )  {
  30.  if ( typeof el. style [ props [ i ] ] ! ==  "undefined" )  {
  31.  prop = props [ i ] ;
  32.  break;
  33.          }
  34.      }
  35.  setInterval ( function ( ) {
  36.  Clock_dg ( prop )
  37.      } , one hundred ) ;
  38.  } ) ;
  39.  < / script >
  40.  < div  style = "text-align:center; margin:-80px 0; font:normal 14px/24px 'MicroSoft YaHei'; " >
  41.  < / div >
Want to be here? contact us bar
 Maker host

CSS3 Creative Round Pointer Clock jQuery Special Effect Code

230 people have bought
  • haft
View Demo Upgrade VIP Buy Now

Demo Address Download address
Collection
fabulous ( zero )

Post reply

Hot selling template

Ashade - Works exhibition photo album WordPress Chinese theme
 LensNews

This site accepts WordPress/PbootCMS/DedeCMS, etc
System construction, imitation, development, customization and other services!