hurtigt spg: hvordan pladser jeg min Div?
hey har dette rykke script:----------kode----------
<? session_start();
include("../connect.php");
$brugernavn = zoom;//$_SESSION['brugernavn'];
$query = mysql_query("SELECT * FROM chatbrugere WHERE bruger = '$brugernavn'") or die(mysql_error());
$row = mysql_fetch_assoc($query);
$sted = $row['sted'];
$besked = $row['besked'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>3D chat test</title>
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
</style>
<script language="javascript">
var Div = null;
var actK = null;
window.onload = function(){
Div = document.getElementById("minDiv");
}
function moveHere(elm){
actK = elm.coords.split(",");
Div.style.left = actK[0] + "px";
Div.style.top = actK[1] + "px";
Div.style.display = "block";
}
function sendthis() {
var besked=document.my_form.besked.value;
document.skjultiframe.location.href="gem.php?sted=" + actK + "&besked=" + besked;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<FORM NAME="my_form" METHOD="POST" ENCTYPE="multipart/form-data">
<div style="position:relative">
<img src="billede.jpg" width="500" height="500" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="138,127,207,196" alt="" name="1" onClick="moveHere(this)" />
<area shape="rect" coords="206,127,275,196" alt="" name="2" onClick="moveHere(this)" />
<area shape="rect" coords="274,127,343,196" alt="" name="3" onClick="moveHere(this)" />
<area shape="rect" coords="342,127,411,196" alt="" name="4" onClick="moveHere(this)" />
<area shape="rect" coords="46,195,113,262" alt="" name="5" onClick="moveHere(this)" />
<area shape="rect" coords="112,195,179,262" alt="" name="6" onClick="moveHere(this)" />
<area shape="rect" coords="178,195,245,262" alt="" name="7" onClick="moveHere(this)" />
<area shape="rect" coords="244,195,311,262" alt="" name="8" onClick="moveHere(this)" />
<area shape="rect" coords="310,195,377,262" alt="" name="9" onClick="moveHere(this)" />
<area shape="rect" coords="376,195,443,262" alt="" name="10" onClick="moveHere(this)" />
<area shape="rect" coords="24,261,90,327" alt="" name="11" onClick="moveHere(this)" />
<area shape="rect" coords="89,261,155,327" alt="" name="12" onClick="moveHere(this)" />
<area shape="rect" coords="154,261,220,327" alt="" name="13" onClick="moveHere(this)" />
<area shape="rect" coords="219,261,285,327" alt="" name="14" onClick="moveHere(this)" />
<area shape="rect" coords="284,261,350,327" alt="" name="15" onClick="moveHere(this)" />
<area shape="rect" coords="70,127,139,196" alt="" name="16" onClick="moveHere(this)" />
<area shape="rect" coords="349,261,415,327" alt="" name="17" onClick="moveHere(this)" />
<area shape="rect" coords="414,261,480,327" alt="" name="18" onClick="moveHere(this)" />
<area shape="rect" coords="23,326,87,390" alt="" name="19" onClick="moveHere(this)" />
<area shape="rect" coords="275,326,339,390" alt="" name="20" onClick="moveHere(this)" />
<area shape="rect" coords="338,326,402,390" alt="" name="21" onClick="moveHere(this)" />
<area shape="rect" coords="401,326,465,390" alt="" name="22" onClick="moveHere(this)" />
<area shape="rect" coords="86,326,150,390" alt="" name="23" onClick="moveHere(this)" />
<area shape="rect" coords="149,326,213,390" alt="" name="24" onClick="moveHere(this)" />
<area shape="rect" coords="212,326,276,390" alt="" name="25" onClick="moveHere(this)" />
<area shape="rect" coords="3,389,67,453" alt="" name="26" onClick="moveHere(this)" />
<area shape="rect" coords="66,389,130,453" alt="" name="27" onClick="moveHere(this)" />
<area shape="rect" coords="129,389,193,453" alt="" name="28" onClick="moveHere(this)" />
<area shape="rect" coords="192,389,256,453" alt="" name="29" onClick="moveHere(this)" />
<area shape="rect" coords="255,389,319,453" alt="" name="30" onClick="moveHere(this)" />
<area shape="rect" coords="318,389,382,453" alt="" name="31" onClick="moveHere(this)" />
<area shape="rect" coords="381,389,445,453" alt="" name="32" onClick="moveHere(this)" />
<area shape="rect" coords="444,389,508,453" alt="" name="33" onClick="moveHere(this)" />
</map><br />
<input type="text" name="besked" onKeyUp="this.form.text.value=this.value" maxlength="48" /> <input type="button" name="my_btn" value="send" onClick="sendthis();">
<div id="minDiv" style="position:absolute;width:64px;height:64px;background:none;background-image:url(chatmand.png)">
<textarea name="text" readonly size="1" style="position:absolute; height:70px; width:120px;overflow:auto;background:transparent; border:0px solid white; left: 49px; top: -29px;">
<? if($besked == "") {}else{ echo $besked; } ?>
</textarea>
</div>
</div>
</form>
<iframe name="skjultiframe" width="1" height="1"></iframe>
</body>
</html>
---------/kode----------
man kan i dette billede med en masse area klikke sig rundt med en div.
men når man opdater siden har div'en sin starts plads udenfor billedet, hvis nu jeg gerne vil ha sådan at når jeg opdater siden skal den starte i fx: coords="149,326,213,390" hvordan gør jeg det?
