<script type="text/javascript">
function advent() {
var heut=new Date();
if (heut.getmonth==11) {
var tag=heut.getDate();
for (var i=1; i<=tag; i++) {
var tuer=document.getElementById("tuer"+i);
if (tuer) tuer.onclick=function() {oeffne(this);};
}
}
}
function oeffne(was) {
if (was) .... [i]was hier steht ergibt sich aus der Art deines Kalenders, du könntest zB ein Bild (=das Türchen) durch ein anderes (=das dahinter) ersetzen[/i]
}
window.onload=advent;
}
</script>if (heut.getMonth()==11) {<img lowsrc="jpg/kalender_low.jpg" border="0" src="jpg/kalender_neu.jpg" usemap="#Map">
<map name="Map" id="tuer1"><area shape="rect" coords="242,473,357,571" href="bild1.html">
<map name="Map" id="tuer2"><area shape="rect" coords="59,736,173,840" href="bild2.html"></map>
<map name="Map" id="tuer3"><area shape="rect" coords="64,210,177,309" href="bild3.html"></map>
...<map name="Map" id="map"><area shape="rect" coords="242,473,357,571" nohref="nohref" title="1">
<area shape="rect" coords="59,736,173,840" nohref="nohref" title="2"></map>
<area shape="rect" coords="64,210,177,309" nohref="nohref" title="3"></map>
<script type="text/javascript">
function advent() {
var heut=new Date();
if (heut.getmonth==11) {
var tag=heut.getDate();
for (var i=1; i<=tag; i++) {
var mappe=document.getElementById("map");
if (mappe) {
var tuer=mappe.getElementsByTagName("area");
for (var a=0; a<tuer.length; a++) {
tuer[a].onclick=function() {oeffne(this);};
}}}}}
function oeffne(was) {
if (was) location.href="bild"+was.title+".htm";
}
window.onload=advent;
}
</script><map name="Map" id="map">
<area shape="rect" coords="242,473,357,571" nohref="nohref" title="1">
<area shape="rect" coords="59,736,173,840" nohref="nohref" title="2">
<area shape="rect" coords="64,210,177,309" nohref="nohref" title="3">
...
</map>window.onload=advent; nicht - wenn ich die wegmache das funktioniert das Script ohne Fehler aber die Links werden nicht generiert - ich hab leider zu wenig Ahnung ...Sorry<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Verweis-sensitive Grafiken definieren - map, area, usemap</title>
<script type="text/javascript">
function advent() {
var heut=new Date();
if (heut.getMonth()==11) {
var tag=heut.getDate();
var mappe=document.getElementById("map");
if (mappe) {
var tuer=mappe.getElementsByTagName("area");
for (var a=0; a<tuer.length; a++) {
if (a<tag) {
tuer[a].style.cursor="hand";
tuer[a].onclick=function() {
oeffne(this);
}
}
else tuer[a].title="Dies Türchen bleibt noch zu";
}
}
}
}
function oeffne(was) {
if (was) location.href="bild"+was.title+".htm";
}
window.onload=advent;
</script>
</head>
<body>
<h1>Schnell zur Stadt oder Region Ihrer Wahl!</h1>
<p>
<img src="karte.png" width="345" height="312" border="0" alt="Karte" usemap="#Landkarte">
<map name="Landkarte" id="map">
<area shape="rect" coords="11,10,59,29" nohref="nohref" title="1">
<area shape="rect" coords="42,36,96,57" nohref="nohref" title="2">
<area shape="rect" coords="42,59,78,80" nohref="nohref" title="3">
<area shape="rect" coords="100,26,152,58" nohref="nohref" title="4">
<area shape="rect" coords="27,113,93,134" nohref="nohref" title="5">
<area shape="rect" coords="100,138,163,159" nohref="nohref" title="6">
<area shape="rect" coords="207,77,266,101" nohref="nohref" title="7">
<area shape="rect" coords="282,62,344,85" nohref="nohref" title="8">
<area shape="rect" coords="255,132,316,150" nohref="nohref" title="9">
<area shape="rect" coords="78,182,132,200" nohref="nohref" title="10">
<area shape="rect" coords="142,169,200,193" nohref="nohref" title="11">
<area shape="rect" coords="140,209,198,230" nohref="nohref" title="12">
<area shape="rect" coords="187,263,222,281" nohref="nohref" title="13">
<area shape="rect" coords="249,278,304,297" nohref="nohref" title="14">
<area shape="poly" coords="48,311,105,248,96,210,75,205,38,234,8,310" nohref="nohref" title="15">
</map>
</p>
</body>
</html>tuer[a].onclick=function() {oeffne(this);};ist auf jeden Fall falsch. Ich vermute, das soll tuer[a].onclick=oeffne(this);
};window.onload=advent;überflüssig.<map name="Map"><area shape="rect" coords="242,473,357,571" href="javascript:advent(1)" title="1">
<area shape="rect" coords="59,736,173,840" href="javascript:advent(2)" title="2"></map>
<area shape="rect" coords="64,210,177,309" href="javascript:advent(3)" title="3"></map>
...<script type="text/javascript">
<!--
var heut=new Date();
heute = heut.getTime();
var test=10;
heut=new Date(heute+(86400000*test));
var tag=heut.getDate();
function advent(tuer) {
if (heut.getMonth()==11 && tuer<=tag) {
location.href= tuer +".htm";
} else alert("Wer wird denn so ungeduldig sein?\nHeute ist erst der "+tag+"."+heut.getMonth()+".");
};
//-->
</script>var test=10;
heut=new Date(heute+(86400000*test));
werden nur zum Testen gebraucht. Du kannst bei var test=10;statt der 10 eine beliebige Zahl eintragen. Um diese Zahl geht der Kalender dann vor. Heute ist der 23.11. Wenn du dort 10 einträgst, wie in meinem Beispiel, geht das Script davon aus, dass heute der 3.12. ist. Wenn du mit dem Testen fertig bist, solltest du entweder bei var test= eine 0 eintragen oder die beiden Zeilen löschen.
else tuer[a].title="Dies Türchen bleibt noch zu";
mit
else alert("Wer wird denn so ungeduldig sein?\nHeute ist erst der "+tag+"."+heut.getMonth()+".");