Archivlink: javarea.de Forum > JavaScript > Zentrieren des Scriptes Drag Drop Tooltipp
Vollständigen Link anzeigen: javarea.de Forum > JavaScript > Zentrieren des Scriptes Drag Drop Tooltipp
Pages: [1]
| geschrieben von Munch am 24.08.2006 - 11:39 |
hi leutz,
hab ein problem....
<script language="JavaScript1.2">
// drag drop function for IE 4+////
/////////////////////////////////
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}
if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
//// drag drop functions end here//////
function hidebox(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}
</script>
und hier die html sache:
<div id="showimage" style="position:absolute;width:250px;left:250;top:200">
<table border="0" width="250" bgcolor="#426399" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td onMousedown="initializedragie()" style="cursor:hand" width="100%"><ilayer width="100%"><layer width="100%" onMouseover="dragswitch=1;drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana" size="2" color="white"><b>Informations - Box</b></font></layer></ilayer></td>
<td style="cursor:hand"><a href="#" onClick="hidebox();return false"><img src="close2.gif" width="16" height="14" border=0></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="2">
<!--INSERT THE HTML CONTENT TO DISPLAY HERE! --------->
<a href="http://www.javarea.de">http://www.javarea</a><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
Ich hab mir also eine funktion geschrieben mit der ich die mitte des Screens ermittle und die hier eingefuegt <div id="showimage" style="position:absolute;width:250px;left:mitte();top:200">. Das funktionbiert soweit, allerdings sobald ich das menü dan anklicke springt es nach rechts fuer ca 300 pixel. Dies passiert aber nur beim ersten anklicken. Meine frage ist wie ich das anders machen kann???
danke! |
| geschrieben von René am 24.08.2006 - 11:40 |
| ja? |
| geschrieben von Munch am 24.08.2006 - 11:42 |
| bin zu blöd für dieses forum, nun ist es da... |
| geschrieben von tyci am 28.08.2006 - 23:30 |
hi,
tempx=showimage.style.pixelLeft+breiteDesDivs/2
|
|