This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Zaehler
#1
Rainbow 
hallo liebes JS-Forum !
ich programmiere mir mit Java Script gerade eine stoppuhr um, welche jede 10 sekunden eine weitere groessere Einheit wieder hochtakten soll. sprich : bei 100 x soll Y +1 hoch gehen. Der x wert soll jedoch nicht genullt werden, sprich er soll dann bei 200x, y wiederrum um 1 erhoehen. mein bisheriger code lautet:



[font=Consolas, "Courier New", monospace]timer: function() {
        if (stop === 0) {
          msecs++;
          if (msecs ===(10)&&(20)) { // hier soll der sekundenwert[/font]

[font=Consolas, "Courier New", monospace]                                     jede 10 schritte erhoeht werden ohne das der wert genullt wird.[/font]
[font=Consolas, "Courier New", monospace]            secs ++;
            msecs ++;
          }[/font]

[font=Consolas, "Courier New", monospace]
          if (secs === 30) {
            mins +=2;
            secs ++;
          }
          if (stein === 3000) {
            mins +=33;
            stein  ++;
          }
          if (mins === 1000) {
            hrs ++;
            mins = 0;
          }
          if (hrs === 1000) {
            days +=1;
            hrs = 0;
          }
          stoppuhr.html();
        }
      },[/font]


wie wuerdet ihr das problem mit der if anweisung loesen?
Heart tausend dank vorab Heart
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste