11.02.2008, 22:56
Hi,
versuch es mal so...
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Bauen</title>
<base target="_self">
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
color: #ffcc00;
font-weight: bold;
}
-->
</style>
<script type='text/javascript'>
<!--
var now = new Date();
var year = now.getYear();
if (year < 1900) {
year += 1900;
}
var NZeit = " 18:00:00 GMT";
var NMonat = "Februar 14, ";
var end = new Date(NMonat + year + NZeit);
function toSt2(n) {
s = "";
if (n < 10) s += "0";
return (s + n).toString();
}
function toSt3(n) {
s = "";
if (n < 10) s += "00";
else if (n < 100) s += "0";
return (s + n).toString();
}
function countdown() {
d = 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("Bauzeit").innerHTML = hours + ':' + minutes + ':' + seconds + '';
document.getElementById("Bauname").innerHTML = "Restzeit";
setTimeout("countdown()", 50);
}
}
//-->
</script>
</head>
<body bgcolor="#510000" onload="countdown()">
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td><div id="Bauname"> </div></td>
<td><div id="Bauzeit"> </div></td>
</tr>
</table>
</body>
</html>[/HTML]
deine Doppelausgabe kommt ja auch vom document.write...
Bitte auch Code blöcke mit dem entsprechenden BB-Code auszeichnen.
Cu Helmut
versuch es mal so...
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Bauen</title>
<base target="_self">
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
color: #ffcc00;
font-weight: bold;
}
-->
</style>
<script type='text/javascript'>
<!--
var now = new Date();
var year = now.getYear();
if (year < 1900) {
year += 1900;
}
var NZeit = " 18:00:00 GMT";
var NMonat = "Februar 14, ";
var end = new Date(NMonat + year + NZeit);
function toSt2(n) {
s = "";
if (n < 10) s += "0";
return (s + n).toString();
}
function toSt3(n) {
s = "";
if (n < 10) s += "00";
else if (n < 100) s += "0";
return (s + n).toString();
}
function countdown() {
d = 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("Bauzeit").innerHTML = hours + ':' + minutes + ':' + seconds + '';
document.getElementById("Bauname").innerHTML = "Restzeit";
setTimeout("countdown()", 50);
}
}
//-->
</script>
</head>
<body bgcolor="#510000" onload="countdown()">
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td><div id="Bauname"> </div></td>
<td><div id="Bauzeit"> </div></td>
</tr>
</table>
</body>
</html>[/HTML]
deine Doppelausgabe kommt ja auch vom document.write...
Bitte auch Code blöcke mit dem entsprechenden BB-Code auszeichnen.
Cu Helmut