Gegen Bilderklau - Das Original (https://www.gegen-bilderklau.net/index.php)
- Design, Website, Copyright (https://www.gegen-bilderklau.net/board.php?boardid=80)
--- Homepagehilfe (https://www.gegen-bilderklau.net/board.php?boardid=27)
---- Homepagehilfe - Archiv (https://www.gegen-bilderklau.net/board.php?boardid=139)
----- [JS] Counter - neues problem (https://www.gegen-bilderklau.net/thread.php?threadid=163901)


Geschrieben von Black Katrin am 26.10.2009 um 13:03:

Fragezeichen Counter - neues problem

Hallöle zusammen Freude

bin im endspurt bezüglich meiner Matur, resp wir sind soweit, und wir haben nen Counter der mittels Javascript läuf (tolle sache macht einem richtig angst -.-)... jedenfalls würden wir gerne dass wenn er bei 0 ankommt das eine Liste von allen 4. Klässlern durchläuft... das problem ist nur, ich hab kA wie ich das machen muss das diese liste erscheint wenn der counter auf 0 steht.

Ich freu mich über hilfe Augenzwinkern

Counter code:
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
<div align=center>
 <SPAN style="FONT: bold 20px arial; COLOR: darkred;">Noch</SPAN><br>
 <SPAN id=c1 style="FONT: bold 40px arial; COLOR: red;"></SPAN><br>
 <SPAN id=c2 style="FONT: bold 35px arial; COLOR: red;">;</SPAN><br>
 <SPAN style="FONT: bold 20px arial; COLOR: darkred;">...bis zum Unterrichtsschluss!</SPAN>
</div>

<script type='text/javascript'>
var end = new Date('November 20, 2009 12:25:00');
function toSt2(n) {
  '';
  if (10+= '0';
  return (n).toString();
}
function toSt3(n) {
  '';
  if (10+= '00';
  else if (100+= '0';
  return (n).toString();
}
function countdown() {
  = new Date();
  count Math.floor(end.getTime() - d.getTime());
  if(count 0) {
    miliseconds toSt3(count%1000); count Math.floor(count/1000);
    seconds toSt2(count%60); count Math.floor(count/60);
    minutes toSt2(count%60); count Math.floor(count/60);
    hours toSt2(count%24); count Math.floor(count/24);
    days count;
    document.getElementById('c1').innerHTML days ' TAGE';
    document.getElementById('c2').innerHTML hours ':' minutes ':' seconds '.' miliseconds;
    setTimeout('countdown()'100);
  }
}
countdown();
</script>



Geschrieben von cll am 28.10.2009 um 15:46:

 

ich würd über JS den Befehl geben ne neue Seite/Frame zu laden in der die Liste ist. Oder ists wichtig dass die alte Seite weiterhin gezeigt wird?



Geschrieben von Black Katrin am 01.11.2009 um 18:09:

 

EDIT
geht doch nicht... wenn man den counter mit ansieht wie er abläuft, dann erhängt er sich sozusagen... also lauftext geht nicht sondern steht da nur dumm rum und die uhr hängt sich auch auf...



Geschrieben von Black Katrin am 01.11.2009 um 19:41:

 

lauftext hab ich rein gecodet, wenn ich aktualisiere funktioniert das auch. aber eben die seite bleibt stehen =/
gäbe es da ne möglichkeit irgendwie die seite zu aktualisiseren per code?



Geschrieben von Black Katrin am 01.11.2009 um 20:02:

 

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
<center><div id="c" style="display: none">
 <SPAN style="FONT: bold 20px arial; COLOR: darkred;">Noch</SPAN><br>
 <SPAN id=c1 style="FONT: bold 40px arial; COLOR: red;"></SPAN><br>
 <SPAN id=c2 style="FONT: bold 35px arial; COLOR: red;">;</SPAN><br>
 <SPAN style="FONT: bold 20px arial; COLOR: darkred;">...bis zum Unterrichtsschluss!</SPAN>
</div>

<div id="classlist" style="display: none;">
<marquee direction="up" scrolldelay="200" height="100%"><center>
<SPAN style="FONT: bold 40px arial; COLOR: red;">4AB</SPAN>

<SPAN style="FONT: bold 35px arial; COLOR: darkred;">
<br>Katrin Affolter</SPAN>
</marquee>
</div>
</center>

<script type='text/javascript'>
var end = new Date('November 1, 2009 18:21:00');
function toSt2(n) {
  '';
  if (10+= '0';
  return (n).toString();
}
function toSt3(n) {
  '';
  if (10+= '00';
  else if (100+= '0';
  return (n).toString();
}
function countdown() {
  = new Date();
  count Math.floor(end.getTime() - d.getTime());
  if(count 0) {
    miliseconds toSt3(count%1000); count Math.floor(count/1000);
    seconds toSt2(count%60); count Math.floor(count/60);
    minutes toSt2(count%60); count Math.floor(count/60);
    hours toSt2(count%24); count Math.floor(count/24);
    days count;
    document.getElementById('c').style.display 'block';
    document.getElementById('c1').innerHTML days ' TAGE';
    document.getElementById('c2').innerHTML hours ':' minutes ':' seconds '.' miliseconds;
    setTimeout('countdown()'100);
  }
  else
  {
    document.getElementById('classlist').style.display 'block';
  }

}
countdown();
</script>



Geschrieben von Black Katrin am 01.11.2009 um 20:49:

 

hä? der lauftext ist nicht das einzige problem, die uhr bleibt auch bei einer komischen zeit stehen und soltle eigendlich verschwinden wenn es bei 0 ankommt



Geschrieben von Black Katrin am 01.11.2009 um 21:01:

 

nicht? wieso funktioniert es dann, ausser wenn er sich aufhängt was ja nen fehler im code ist?



Geschrieben von Black Katrin am 02.11.2009 um 06:33:

 

Zitat:
Original von Mordred
Zitat:
Original von Black Katrin
nicht? wieso funktioniert es dann, ausser wenn er sich aufhängt was ja nen fehler im code ist?


Funktioniert auch nicht wenn es sich nicht 'aufhängt'


glückwunsch wenn dus ohne aufhängen hinbekommen hast. wir habens jetzt mit ner weiterleitung gelöst


Forensoftware: Burning Board, entwickelt von WoltLab GmbH