nette änderung!
geb mir grad 5 sek, ich bastel mal was

So:
Code: Alles auswählen
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Map</title>
<style type="text/css">
<!--
p,ul,ol,div,td,span,
layer,table,body { font-family: Arial, helvetica, sans-serif; font-size: 12px; color: #222222; }
p { margin: 0px; padding: 0px; }
a:link { color:#CC3300; text-decoration:none; font-weight:bold; }
a:visited { color:#CC3300; text-decoration:none; font-weight:bold; }
a:active { color:#FF3300; text-decoration:hover; font-weight:bold; }
a:hover { color:#FF3300; text-decoration:underline; font-weight:bold; }
h1 { font-size:12px; font-weight:bold; margin-bottom: 0px;}
.medium { font-size:11px; }
.small { font-size:10px; }
.framemapbg { margin: 10px; margin-top: 3px; }
p.positiontext { background-color: #BBBBBB; border: 1px solid #555555; color: #000000; font-size: 10px; margin-left: 0px; margin-right: 0px; margin-bottom: 3px; padding-left: 0px; padding-right: 0px; width: 100%; }
img.nocango {background: transparent;}
a.nocango {background: #transparent; height: 50px; width: 50px; border-width: 0; display: block;}
a.nocango:hover {background: url(../images/map/nocango.gif) top left no-repeat; cursor: default;}
a:focus{outline:0; -moz-outline:0; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
function stopErrors() {
return true;
}
window.onerror = stopErrors;
var NS6 = (!document.all && document.getElementById) ? true : false;
var NS = document.layers ? 1:0;
var IE = document.all ? 1:0;
var gecko = document.getElementById ? 1:0;
var wielang=4;
if(wielang<=0)
wielang=1;
var target="test";
var timer = window.setInterval("countdown()",1000);
function countdown()
{
sekunden=wielang;
text=sekunden;
if (NS)
{
x = document.layers[target];
if(wielang!=0)
text2 = 'Du kannst in ' + (text/60>=1?Math.floor(text/60)+' Minuten und ':'')+(text%60) + ' Sekunden weiterreisen';
else
text2 = '';
x.document.open();
x.document.write(text2);
x.document.close();
}
else if (IE)
{
x = document.all[target];
if(wielang!=1)
text2 = 'Du kannst in ' + ((text-1)/60>=1?Math.floor((text-1)/60)+' Minuten und ':'')+((text-1)%60) + ' Sekunden weiterreisen';
else
text2 = '';
x.innerHTML = text2;
}
else if (gecko)
{
x = document.getElementById(target);
if(wielang!=1)
text2 = 'Du kannst in ' + ((text-1)/60>=1?Math.floor((text-1)/60)+' Minuten und ':'')+((text-1)%60) + ' Sekunden weiterreisen';
else
text2 = '';
x.innerHTML = text2;
}
else
{
x = document.all[target];
if(wielang!=1)
text2 = 'Du kannst in ' + ((text-1)/60>=1?Math.floor((text-1)/60)+' Minuten und ':'')+((text-1)%60) + ' Sekunden weiterreisen';
else
text2 = '';
x.innerHTML = text2;
}
wielang--;
if (wielang<=0)
window.clearInterval(timer);
}
function Move(direction)
{
if(wielang<=1)
{
$.ajax({
type: "GET",
url: "counter.js",
dataType: "script"
});
$.ajax({
type: "GET",
url: "map.php",
data: "walk="+direction+"&intwalkid=1337",
success: function(data){
$("#map").html(data);
}
});
}
}
$(document).ready(function(){
$("td").click(Move(this.href));
});
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="framemapbg">
<script language="JavaScript">
var IE = document.all ? 1:0;
if (IE)
{
parent.chattextFrame.location.href = 'chattext.php';
parent.mainFrame.location.href = 'main.php';
}
else
{
parent.frames.chattextFrame.location.href = 'chattext.php';
parent.frames.mainFrame.location.href = 'main.php';
}
</script>
<div id="map">
<div align="center">
<p class="positiontext"><a href="map.php?reload=1"><img src="../images/relmap.gif" align="top" border=0></a> Position X: 90 Y: 102</p></div>
<table width="250" height="250" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="50" id="mapx88y100" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx89y100" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx90y100" style="background-image:url(http://85.10.193.197/freewar/images/map/onloshop.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx91y100" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx92y100" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td> </tr>
<tr>
<td width="50" height="50" id="mapx88y101" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx89y101" style="background-image:url(http://85.10.193.197/freewar/images/map/onlospawn.jpg);"><a href="#upleft" ><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx90y101" style="background-image:url(http://85.10.193.197/freewar/images/map/forest4.jpg);"><a href="#up" ><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx91y101" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#upright" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx92y101" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td> </tr>
<tr>
<td width="50" height="50" id="mapx88y102" style="background-image:url(http://85.10.193.197/freewar/images/map/asche2.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx89y102" style="background-image:url(http://85.10.193.197/freewar/images/map/forest5.jpg);"><a href="#left" ><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx90y102" style="background-image:url(http://85.10.193.197/freewar/images/map/onlosteine.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/user.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx91y102" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#right" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx92y102" style="background-image:url(http://85.10.193.197/freewar/images/map/forest2.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td> </tr>
<tr>
<td width="50" height="50" id="mapx88y103" style="background-image:url(http://85.10.193.197/freewar/images/map/asche1.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx89y103" style="background-image:url(http://85.10.193.197/freewar/images/map/forest5.jpg);"><a href="#downleft" ><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx90y103" style="background-image:url(http://85.10.193.197/freewar/images/map/forest4.jpg);"><a href="#down" ><img src="http://85.10.193.197/freewar/images/map/zahl1.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx91y103" style="background-image:url(http://85.10.193.197/freewar/images/map/forest.jpg);"><a href="#downright" ><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx92y103" style="background-image:url(http://85.10.193.197/freewar/images/map/forest2.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td> </tr>
<tr>
<td width="50" height="50" id="mapx88y104" style="background-image:url(http://85.10.193.197/freewar/images/map/asche3.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx89y104" style="background-image:url(http://85.10.193.197/freewar/images/map/kim.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx90y104" background="http://85.10.193.197/freewar/images/map/std.jpg" class="stdjpg" class="stdjpg"><a href="#" class="nocango"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx91y104" style="background-image:url(http://85.10.193.197/freewar/images/map/postoffice.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl2.gif" width="50" height="50" border=0></a></td><td width="50" height="50" id="mapx92y104" style="background-image:url(http://85.10.193.197/freewar/images/map/forest.jpg);"><a href="#" style="{cursor: default;}"><img src="http://85.10.193.197/freewar/images/map/zahl0.gif" width="50" height="50" border=0></a></td> </tr>
</table>
</div>
<div id="test" align="center" class="small"><span class="small">Sie müssen Javascript aktiviert haben</span></div>
<script type="text/javascript">
countdown();
</script>
<script language="JavaScript">
document.body.background = '../images/itembg.jpg';
</script>
</body>
</html>
Und halt die Ausgabe der map aufteilen einmal in if(!isset($_GET)) das wäre dann ganz normal if(isset($_GET['reload'])); der reload eben und eben if(isset($_GET['direction'] AND $_GET['intwalkid']));
btw. die direction müsste jetzt dann auch ein # vornestehn und es gibt felder ohne direction, entweder man umgeht dies und bau für 8 felder ein click event und nicht so wie ich oder *gg* man macht bei der Move Funktion noch if(direction != "") {}
so irgendwie müssts gehn (: ajax leicht gemacht ^^ der countdown kann ich dir aber auch so bauen, das du bei isset $_GET direction einfach die json ausgabe wählst und mir den timer wert zurückgibst (:
btw sorry is nur so hingekritzelt, aber wenn es so langsam gemacht wird kann man dann auch die felder ausfaden oder fadein und das war jetzt nit so schwer *gg*