Skip to content
Loading
  
  •         class="cell">  
  •             class="numbers hour moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •         class="cell divider">class="numbers">:  
  •         class="cell">  
  •             class="numbers tenminute movesix">0 1 2 3 4 5 6  
  •           
  •         class="cell">  
  •             class="numbers minute moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •         class="cell divider">class="numbers">:  
  •         class="cell">  
  •             class="numbers tensecond movesix">0 1 2 3 4 5 6  
  •           
  •         class="cell">  
  •             class="numbers second moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •         class="cell divider">class="numbers">:  
  •         class="cell">  
  •             class="numbers milisecond moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •         class="cell">  
  •             class="numbers tenmilisecond moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •         class="cell">  
  •             class="numbers hundredmilisecond moveten">0 1 2 3 4 5 6 7 8 9  
  •           
  •       
  •       
  •     "timer_controls">  
  •         for="start">Start  
  •         for="stop">Stop  
  •         for="reset">Reset  
  •       
  •   
  •   
  •   
  • When user clicks on STOP it should display time in a table without storing it any db.
    0
  • Laxmidhar Sahoo
    0
    Hi can tell me in chich div the display time stored
    0
  • Garishma G
    0
    Laxmidhar Sahoo I have not created a div for it yet. could you please guide me with the same ?
    Thanks :) 
    0
  • Laxmidhar Sahoo
    0
    I jsut provide you the demo .You modify and change the logic
     
    1.     
    2. <html>    
    3. <head>    
    4.  <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">  
    5. <style>    
    6. * {margin: 0; padding: 0;}    
    7.     
    8. .container {    
    9.     padding: 10px;    
    10.     text-align: center;    
    11. }    
    12.     
    13. .timer {    
    14.     padding: 10px;    
    15.     background: linear-gradient(top, #222, #444);    
    16.     overflow: hidden;    
    17.     display: inline-block;    
    18.     border: 7px solid #efefef;    
    19.     border-radius: 5px;    
    20.     position: relative;    
    21.         
    22.     box-shadow:     
    23.         inset 0 -2px 10px 1px rgba(0, 0, 0, 0.75),     
    24.         0 5px 20px -10px rgba(0, 0, 0, 1);    
    25. }    
    26.     
    27. .cell {    
    28.     /*Should only display 1 digit. Hence height = line height of .numbers   
    29.     and widthwidth = width of .numbers*/    
    30.     width: 0.60em;    
    31.     height: 40px;    
    32.     font-size: 50px;    
    33.     overflow: hidden;    
    34.     position: relative;    
    35.     float: left;    
    36. }    
    37.     
    38. .numbers {    
    39.     width: 0.6em;    
    40.     line-height: 40px;    
    41.     font-family: digital, arial, verdana;    
    42.     text-align: center;    
    43.     color: #fff;    
    44.         
    45.     position: absolute;    
    46.     top: 0;    
    47.     left: 0;    
    48.         
    49.     /*Glow to the text*/    
    50.     text-shadow: 0 0 5px rgba(255, 255, 255, 1);    
    51. }    
    52.     
    53. /*Styles for the controls*/    
    54. #timer_controls {    
    55.     margin-top: -5px;    
    56.     padding-top: 20px;    
    57. }    
    58. #timer_controls label {    
    59.     cursor: pointer;    
    60.     padding: 5px 10px;    
    61.     background: #efefef;    
    62.     font-family: arial, verdana, tahoma;    
    63.     font-size: 20px;    
    64.     border-radius: 0 0 3px 3px;    
    65. }    
    66. input[name="controls"] {display: none;}    
    67.     
    68. /*Control code*/    
    69. #stop:checked~.timer .numbers {animation-play-state: paused;}    
    70. #start:checked~.timer .numbers {animation-play-state: running;}    
    71. #reset:checked~.timer .numbers {animation: none;}    
    72.     
    73. .moveten {    
    74.     /*The digits move but dont look good. We will use steps now   
    75.     10 digits = 10 steps. You can now see the digits swapping instead of    
    76.     moving pixel-by-pixel*/    
    77.     animation: moveten 1s steps(10, end) infinite;    
    78.     /*By default animation should be paused*/    
    79.     animation-play-state: paused;    
    80. }    
    81. .movesix {    
    82.     animation: movesix 1s steps(6, end) infinite;    
    83.     animation-play-state: paused;    
    84. }    
    85.     
    86. /*Now we need to sync the animation speed with time speed*/    
    87. /*One second per digit. 10 digits. Hence 10s*/    
    88. .second {animation-duration: 10s;}    
    89. .tensecond {animation-duration: 60s;} /*60 times .second*/    
    90.     
    91. .milisecond {animation-duration: 1s;} /*1/10th of .second*/    
    92. .tenmilisecond {animation-duration: 0.1s;}    
    93. .hundredmilisecond {animation-duration: 0.01s;}    
    94.     
    95. .minute {animation-duration: 600s;} /*60 times .second*/    
    96. .tenminute {animation-duration: 3600s;} /*60 times .minute*/    
    97.     
    98. .hour {animation-duration: 36000s;} /*60 times .minute*/    
    99. .tenhour {animation-duration: 360000s;} /*10 times .hour*/    
    100.     
    101. @keyframes moveten {    
    102.     0% {top: 0;}    
    103.     100% {top: -400px;}     
    104.     /*height = 40. digits = 10. hence -400 to move it completely to the top*/    
    105. }    
    106.     
    107. @keyframes movesix {    
    108.     0% {top: 0;}    
    109.     100% {top: -240px;}     
    110.     /*height = 40. digits = 6. hence -240 to move it completely to the top*/    
    111. }    
    112.     
    113. style>   
    114.    
    115. head>    
    116. <body style="background-color:#000">    
    117. <div class="container">    
    118.         
    119.     <input id="start" name="controls" type="radio" />    
    120.     <input id="stop" name="controls" type="radio" />    
    121.     <input id="reset" name="controls" type="radio" />    
    122.     <div class="timer">    
    123.         <div class="cell">    
    124.             <div class="numbers tenhour moveten">0 1 2 3 4 5 6 7 8 9div>    
    125.         div>    
    126.         <div class="cell">    
    127.             <div class="numbers hour moveten">0 1 2 3 4 5 6 7 8 9div>    
    128.         div>    
    129.         <div class="cell divider"><div class="numbers">:div>div>    
    130.         <div class="cell">    
    131.             <div class="numbers tenminute movesix">0 1 2 3 4 5 6div>    
    132.         div>    
    133.         <div class="cell">    
    134.             <div class="numbers minute moveten">0 1 2 3 4 5 6 7 8 9div>    
    135.         div>    
    136.         <div class="cell divider"><div class="numbers">:div>div>    
    137.         <div class="cell">    
    138.             <div class="numbers tensecond movesix">0 1 2 3 4 5 6div>    
    139.         div>    
    140.         <div class="cell">    
    141.             <div class="numbers second moveten">0 1 2 3 4 5 6 7 8 9div>    
    142.         div>    
    143.         <div class="cell divider"><div class="numbers">:div>div>    
    144.         <div class="cell">    
    145.             <div class="numbers milisecond moveten">0 1 2 3 4 5 6 7 8 9div>    
    146.         div>    
    147.         <div class="cell">    
    148.             <div class="numbers tenmilisecond moveten">0 1 2 3 4 5 6 7 8 9div>    
    149.         div>    
    150.         <div class="cell">    
    151.             <div id = "mili" class="numbers hundredmilisecond moveten">0 1 2 3 4 5 6 7 8 9div>    
    152.         div>    
    153.     div>    
    154.         
    155.     <div id="timer_controls">    
    156.         <label id="begin" for="start">Startlabel>    
    157.         <label id="stop" for="stop">Stoplabel>    
    158.         <label for="reset">Resetlabel>    
    159.     div>    
    160.   
    161. <table id="example">  
    162.   <thead>  
    163.     <tr style="background-color:white;color:black"><th>Last modifiedth>tr>  
    164.   thead>  
    165.    
    166. table>  
    167. <br>  
    168. <div id="displaytext" style="background-color:black;color:white;">testdiv>  
    169. <br>  
    170. <div id="displaytable" style="background-color:black;color:white;">testdiv>  
    171. div>    
    172.  <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js">script>  
    173.   <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js">script>   
    174. <script>  
    175.   
    176.   
    177. var milihundred = 0;  
    178.   
    179. var dmilisten = 0;  
    180. var dmilihundred = 0;  
    181. var dmilis = 0;  
    182. var dsec = 0;  
    183. var dmin = 0;  
    184. var begin = false;  
    185. var x = setInterval(function() {  
    186. if(begin)  
    187. {  
    188.  milihundred++;  
    189.    
    190.   dmilihundred =  milihundred % 10;  
    191.   dmilisten =  parseInt((milihundred/10)) % 10;  
    192.   dmilis = parseInt((milihundred/100)) % 10;  
    193.   if( milihundred == 1000)  
    194.   {  
    195.      dsec++;  
    196.      if(dsec == 60)  
    197.      {  
    198.      dmin++;  
    199.      if(dmin == 60)  
    200.     {     
    201.      dmin = 0;  
    202.     }  
    203.       dsec = 0;   
    204.      }    
    205.       
    206.      milihundred = 0;  
    207.   }  
    208.  var dis = dmin + ':' + dsec + ':' + dmilis + dmilisten + dmilihundred;  
    209.  $("#displaytext").html(dis);  
    210. }     
    211. },1);  
    212. $(document).ready(function(){  
    213.   
    214. var ad = [  
    215.     ["2013-10-15 10:30:00"]  
    216.       
    217.   ];  
    218.   function explode(){  
    219.    
    220.      
    221. }  
    222. setTimeout(explode, 1);  
    223.   
    224. $("#begin").click(function(){  
    225. begin = true;  
    226.   
    227. });  
    228. $("#stop").click(function(){  
    229. var value = $("#displaytext").html();  
    230. begin = false;  
    231. var r  = '

      '+ value + 'p>';  

    232. $("#displaytable").append(r);  
    233. alert(value);  
    234. });  
    235. });  
    236. script>  
    237. body>    
    238. html>    
     
    0