Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zegarek, Jak usunąć pole tekstowe?
lojciec14
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 29.06.2009

Ostrzeżenie: (0%)
-----


Witam. Znalazłem niezły zegarek w sieci i chciałem się dowiedzieć, jak go zmodyfikować, żeby usunąć z niego pole tekstowe?

Link: http://webmaster.helion.pl/kurshtml/skrypt/zegarek.htm

Dzięki za pomoc.
Go to the top of the page
+Quote Post
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


tzn jakie pole tekstowe chodzi Tobie o input questionmark.gif
  1. <script language="javascript">
  2. <!--W3e JAVAscript Preset
  3. var timerID = null;
  4. var timerRunning = false;
  5. function stopclock()
  6. {
  7. if(timerRunning)
  8. clearTimeout(timerID)
  9. timerRunning = false;
  10. }
  11.  
  12. function startclock()
  13. {
  14. stopclock();
  15. showtime();
  16. }
  17.  
  18. function showtime()
  19. {
  20. var now = new Date();
  21. var hours = now.getHours();
  22. var minutes = now.getMinutes();
  23. var seconds = now.getSeconds();
  24. var timeValue = "" + ((hours > 12) ? hours - 12 : hours);
  25. timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  26. timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  27. timeValue += (hours >= 12) ? " P.M." : " A.M.";
  28. document.getElementById( 'oClock' ) = timeValue;
  29. timerID = setTimeout("showtime()",1000);
  30. timerRunning = true;
  31. }
  32. //-->
  33.  
  34. <div id="oClock"></div>
  35.  
  36. <script>startclock();</script>

*pisane z palca.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
lojciec14
post
Post #3





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 29.06.2009

Ostrzeżenie: (0%)
-----


Dokładnie chodzi mi o input. Skrypt, który podałeś nie chce ruszyć...
Go to the top of the page
+Quote Post
skowron-line
post
Post #4





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


Mówisz i masz
  1. <script language="javascript">
  2. <!--W3e JAVAscript Preset
  3. var timerID = null;
  4. var timerRunning = false;
  5. function stopclock()
  6. {
  7. if(timerRunning)
  8. clearTimeout(timerID)
  9. timerRunning = false;
  10. }
  11.  
  12. function startclock()
  13. {
  14. stopclock();
  15. showtime();
  16. }
  17.  
  18. function showtime()
  19. {
  20. var now = new Date();
  21. var hours = now.getHours();
  22. var minutes = now.getMinutes();
  23. var seconds = now.getSeconds();
  24. var timeValue = "" + ((hours > 12) ? hours - 12 : hours);
  25. timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  26. timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  27. timeValue += (hours >= 12) ? " P.M." : " A.M.";
  28.  
  29. document.getElementById( 'oClock' ).innerHTML = timeValue;
  30.  
  31. timerID = setTimeout("showtime()",1000);
  32. timerRunning = true;
  33. }
  34. //-->
  35.  
  36. <body onload="startclock();">
  37. <div id="oClock"></div>


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
lojciec14
post
Post #5





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 29.06.2009

Ostrzeżenie: (0%)
-----


Dzięki. A dałoby radę dołożyć jeszcze napis Godzina: (tutaj wyświetlany zegar) questionmark.gif Chodzi mi o to, że jak przed skryptem postawię napis godzina, to robi mi po nim enter, a chciałbym mieć to wszystko w jednej linii. No i jeszcze jedno. Jak zamienić system 12h na 24h ?
Go to the top of the page
+Quote Post
Wicepsik
post
Post #6





Grupa: Zarejestrowani
Postów: 1 575
Pomógł: 299
Dołączył: 26.03.2009

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


  1. <script language="javascript">
  2. <!--W3e JAVAscript Preset
  3. var timerID = null;
  4. var timerRunning = false;
  5. function stopclock()
  6. {
  7. if(timerRunning)
  8. clearTimeout(timerID)
  9. timerRunning = false;
  10. }
  11.  
  12. function startclock()
  13. {
  14. stopclock();
  15. showtime();
  16. }
  17.  
  18. function showtime()
  19. {
  20. var now = new Date();
  21. var hours = now.getHours();
  22. var minutes = now.getMinutes();
  23. var seconds = now.getSeconds();
  24. var timeValue = hours;
  25. timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  26. timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  27.  
  28.  
  29. document.getElementById( 'oClock' ).innerHTML = timeValue;
  30.  
  31. timerID = setTimeout("showtime()",1000);
  32. timerRunning = true;
  33. }
  34. //-->
  35.  
  36. <body onload="startclock();">
  37. <div id="oClock"></div>


Tak trudno popatrzeć na kod? Nie znam się na javascript i jakoś mi się udało... MYŚL!

Ten post edytował Wicepsik 29.06.2009, 10:28:26


--------------------
Go to the top of the page
+Quote Post
skowron-line
post
Post #7





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


  1. document.getElementById( 'oClock' ).innerHTML = "Godzina: "+timeValue;


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
lojciec14
post
Post #8





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 29.06.2009

Ostrzeżenie: (0%)
-----


Dziękuję serdecznie. Wszystko działa jak należy smile.gif Efekt można zobaczyć tutaj: http://oldschoolplayers.pl/index.php?act=uportal tabelka "Dzisiaj po prawej stronie smile.gif
Go to the top of the page
+Quote Post
kamil4u
post
Post #9





Grupa: Zarejestrowani
Postów: 2 350
Pomógł: 512
Dołączył: 4.01.2009
Skąd: Wrocław / Świdnica

Ostrzeżenie: (0%)
-----


Ja jeszcze dam link do pewnego zegarka : http://rafael.webd.pl/tmp/zegar/ - warto spojrzeć w kod smile.gif

Ten post edytował kamil4u 29.06.2009, 13:25:03


--------------------
Go to the top of the page
+Quote Post
nexis
post
Post #10





Grupa: Zarejestrowani
Postów: 1 012
Pomógł: 109
Dołączył: 26.09.2003
Skąd: nexis.pl

Ostrzeżenie: (0%)
-----


  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <title>Zegarek</title>
  5. <script type="text/javascript">
  6. function showtime()
  7. {
  8. var now = new Date();
  9. var hours = now.getHours();
  10. var minutes = now.getMinutes();
  11. var seconds = now.getSeconds();
  12. var timeValue;
  13.  
  14. timeValue = hours;
  15. timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  16. timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  17.  
  18. document.getElementById( 'oClock' ).innerHTML = 'Godzina ' + timeValue;
  19.  
  20. setTimeout("showtime()", 1000);
  21. }
  22. </script>
  23. </head>
  24. <body onload="showtime();">
  25. <div id="oClock"></div>
  26. </body>
  27. </html>


Ten post edytował nexis 29.06.2009, 13:41:00


--------------------
Zend Certified Engineer

Kliknij POMÓGŁ jeśli moja odpowiedź okazała się użyteczna!
Go to the top of the page
+Quote Post
kefirek
post
Post #11





Grupa: Zarejestrowani
Postów: 781
Pomógł: 256
Dołączył: 29.06.2008

Ostrzeżenie: (0%)
-----


  1. <script type="text/javascript">
  2. function czas()
  3. {
  4. var d = new Date();
  5. sekund = (d.getSeconds());
  6. minut = (d.getMinutes());
  7. godzin = (d.getHours());
  8. if (minut<=9)
  9. minut= "0" + minut;
  10. if (sekund <= 9 )
  11. sekund ="0" + sekund;
  12. if (godzin <= 9 )
  13. godzin ="0" + godzin;
  14.  
  15. document.getElementById('div1').innerHTML = "Czas: " + godzin + ":" + minut + ":" + sekund;
  16. }
  17.  
  18. window.setInterval(czas,1000);
  19.  
  20. <div id="div1"></div>
Go to the top of the page
+Quote Post

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 Aktualny czas: 22.08.2025 - 07:52