Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php]Odliczenie
Forum PHP.pl > Forum > Przedszkole
matik000
Jest możliwość wykonać skrypt w php
który będzię odliczał 5 minut i dopiero po tym czasie będzie wykonywać dalszą cześć skryptu
np

echo "Zostalo $czas minut";
wookieb
Coś takiego to bardziej w javascript. google -> javascript countdown
matik000
  1.  
  2.  
  3. countdown = function(){
  4. /*
  5. configuration of script, properties with
  6. values and labels will become form elements!
  7. */
  8. var cfg = {
  9. displayID:'display',
  10. preferencesID:'preferences',
  11. finalClass:'final',
  12. overClass:'over',
  13. initialText:{
  14. value:'1:00',
  15. label:'Initial Text'
  16. },
  17. seconds:{
  18. value:1*60,
  19. label:'Time in Seconds'
  20. },
  21. finalCountdown:{
  22. value:30,
  23. label:'Warning start'
  24. },
  25. pauseLabel:{
  26. value:'pause',
  27. label:'Pause Text'
  28. },
  29. resumeLabel:{
  30. value:'resume',
  31. label:'Resume Text'
  32. },
  33. resetLabel:{
  34. value:'reset',
  35. label:'Reset Text'
  36. },
  37. startLabel:{
  38. value:'start',
  39. label:'Start Text'
  40. }
  41. };
  42.  
  43. /* presets */
  44. var seconds = cfg.seconds.value;
  45. var interval = null;
  46. var secs = null;
  47. var startTime = null;
  48. var realsecs = null;
  49.  
  50. /* create display */
  51. var display = document.createElement('div');
  52. display.id = cfg.displayID;
  53. document.body.appendChild(display);
  54. display.innerHTML = cfg.initialText.value;
  55.  
  56.  
  57. function startCountDown(){
  58. pauseButton.disabled = false;
  59. startButton.disabled = true;
  60. startTime = new Date();
  61. interval = setInterval(countdown.doCountDown, 100);
  62. }
  63. startCountDown()
  64. //return {doCountDown:doCountDown};
  65. }();
  66. </script>

Jest tu jakiś programista js ? Mógłby poprawić . wyświetla 1:00
ale nie odlicza .. chce zrobić tak by po odliczeniu do 0:00 przenosił do danej witryny..
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.