Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Zegarek
Potar
post 26.05.2012, 23:23:44
Post #1





Grupa: Zarejestrowani
Postów: 53
Pomógł: 0
Dołączył: 27.02.2010

Ostrzeżenie: (20%)
X----


Mam problem ze skryptem, po prostu zegarek nie działa biggrin.gif

  1. <div class=title>Server Time</div>
  2. .clock {width:160px;margin:0 auto;padding:0px;color:#fff;}
  3. .clock ul {width:160px;margin:0 auto;padding:0px;list-style:none;text-align:center; }
  4. .clock ul li {display:inline;font-size:20px;text-align:center;font-family:'BebasNeueRegular', Arial, Helvetica, sans-serif;text-shadow:0 0 5px #00c6ff;}
  5. #point { position:relative;padding-left:3px;padding-right:3px;}
  6. </style>
  7. function cu(ct){
  8. if (ct > 60*60*24-1)
  9. {
  10. ct=0;
  11. secs = parseInt(ct);
  12. hh = secs / 3600;
  13. hh = parseInt(hh);
  14. mmt = secs - (hh * 3600);
  15. mm = mmt / 60;
  16. mm = parseInt(mm);
  17. ss = mmt - (mm * 60);
  18. if (ss < 10) { ss = "0"+ss; }
  19. if (mm < 10) { mm = "0"+mm; }
  20. if (hh < 10) { hh = "0"+hh; }
  21. $('#hours').html(hh.toString());
  22. $('#min').html(mm.toString());
  23. $('#sec').html(ss.toString());
  24. setTimeout('cu('+ct+')', 940);
  25. }
  26. else
  27. {
  28. ct=ct+1;
  29. secs = parseInt(ct);
  30. hh = secs / 3600;
  31. hh = parseInt(hh);
  32. mmt = secs - (hh * 3600);
  33. mm = mmt / 60;
  34. mm = parseInt(mm);
  35. ss = mmt - (mm * 60);
  36. if (ss < 10) { ss = "0"+ss; }
  37. if (mm < 10) { mm = "0"+mm; }
  38. if (hh < 10) { hh = "0"+hh; }
  39. $('#hours').html(hh.toString());
  40. $('#min').html(mm.toString());
  41. $('#sec').html(ss.toString());
  42. setTimeout('cu('+ct+')', 940);
  43. }
  44. }
  45. $("#clock").ready(function() {
  46. cu(4450);
  47. });
  48. </script>
  49. <div class="clock">
  50. <ul>
  51. <li id="hours"></li>
  52. <li id="point">:</li>
  53. <li id="min"></li>
  54. <li id="point">:</li>
  55. <li id="sec"></li>
  56. </ul>
  57. </div>


--------------------
Odwiedź moją stronę!
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:14