16. juni 2005 - 23:52
Der er
8 kommentarer
Finde left og top på en div
Hejsa, hvordan sætter jeg left og top akserne fra diven "you" til diven "talebobbel"? har prøvet med <div id="talebobbel" style="left: document.getElementById("you").left.style;"></div>, men desværre uden held.
Annonceindlæg fra Computerworld it-jobbank
Tilfreds? :) <script type="text/javascript"> var d = document, k, CapsLock = false; $content = ""; var sChars = { "k48":["=","0"], "k49":["!","1"], "k50":["\"","2"], "k51":["#","3"], "k52":["¤","4"], "k53":["%","5"], "k54":["&","6"], "k55":["/","7"], "k56":["(","8"], "k57":[")","9"], "k58":["(","8"], "k186":["^","¨"], "k187":["?","+"], "k188":[";",","], "k189":["_","-"], "k190":[":","."], "k191":["*","'"], "k219":["`","´"], "k220":["§","½"], "k226":[">","<"] } function GtLt(indData) { return indData.replace(/</, "<").replace(/>/, ">"); } function MaxWordLengthExeeded() { $pattern = /\S{11,}$/; return $pattern.test($content); } function Clear() { parent.system.location = 'ikkeaktiv.php'; $deaf=false; $content = ''; document.getElementById('textGoesHere').innerHTML = ""; document.getElementById('textGoesHereTable').style.visibility = "hidden"; } function CK(e) { e = (!e) ? event : e; k = e.keyCode; if (sChars["k"+k]) { $content += (e.shiftKey) ? sChars["k"+k][0] : sChars["k"+k][1]; } else { switch (k) { case 8 : if ($content.length > 0) $content = $content.substr(0, $content.length-1); break; case 13 : if ($content != "") { $deaf = true; setTimeout("Clear()", 10000); document.getElementById('textGoesHere').style.color="black"; parent.system.document.getElementById('js').src = 'skriv.php?besked=' + encodeURI($content); document.getElementById('talebobbel').innerHTML = '' + encodeURI($content); $content = ""; break; } case 16 : return false break; case 18 : break; case 20 : CapsLock = !CapsLock; break; case 27 : document.getElementById('textGoesHere').style.color="gray"; $content = ""; break; case 112 : case 113 : case 114 : case 115 : case 116 : case 117 : case 118 : case 119 : case 120 : case 121 : case 122 : case 123 : case 17 : break; case 192 : $content += (e.shiftKey ^ CapsLock) ? "Æ" : "æ"; break; case 221 : $content += (e.shiftKey ^ CapsLock) ? "Å" : "å"; break; case 222 : $content += (e.shiftKey ^ CapsLock) ? "Ø" : "ø"; break; default: $content += (e.shiftKey ^ CapsLock) ? String.fromCharCode(k) : String.fromCharCode(k).toLowerCase(); } } if ($content != "" && MaxWordLengthExeeded()) $content = $content.substr(0, $content.length-1); if ($content != "") document.getElementById('textGoesHereTable').style.visibility = "visible"; else document.getElementById('textGoesHereTable').style.visibility = "hidden"; if ($content.length > 70) $content = $content.substr(0, 70); document.getElementById('textGoesHere').innerHTML = $content; e.cancelBubble = true; if (e.preventDefault) e.preventDefault(); else e.keyCode = 0; return false; }; d.onkeydown=CK; </script> <div id='talk' class='bubble' name='talk' style='POSITION: absolute; overflow:hidden; top: -150; left: -100; width: 120; z-index: 99999999999999992; text-align:right; right:-15; bottom:-40; '> <table border="0" style="width:75px;height:100px;"> <tr><br><br><td align="right" valign="bottom"> <table border="0" cellpadding="0" cellspacing="0" id="textGoesHereTable" style="visibility: hidden;height:20px;"> <tr> <td height="3" width="3" background="talebobler/top-venstre.gif"></td> <td height="3" background="talebobler/top.gif"></td> <td height="3" width="5" background="talebobler/top-hojre.gif"></td> </tr> <tr> <td width="3" background="talebobler/venstre.gif"></td> <td bgcolor="#FFFFFF"><font color=gray font=tahoma size=1><div id="textGoesHere"></div></i></font></td> <td width="5" background="talebobler/hojre.gif"></td></tr> <tr><td height="5" width="3" background="talebobler/bund-venstre.gif"></td> <td height="5" background="talebobler/bund.gif"></td> <td height="5" width="5" background="talebobler/bund-hojre.gif"> </td></tr></table></td></tr></table></div>