
w kazdym razie, mam problem z ta funkcja, moge dowolnie manipulowac pozycja diva dragowac dropowac ale wewnetrzne textarea nie daje sie zaFocusowac lewoklikiem...
jak to przejsc?
ot i kod
<html> <head> <script TYPE="text/javascript"> cpdd='********** DRAG & DROP *********?= '+ 'Written by Bogdan Blaszczak '+ 'homepage http://www.blatek.25.pl/javascript/' //don't edit lines above var selOB,glIx=0 function DragObj(w){ with(d)this.id=g?g(w):a?a[w].l[w]
if(d.l)this.id.captureEvents(Event.MOUSEDOWN) this.id.onmousedown=C this.id.onselectstart=new Function('return false') function C(e){ eval(st(hots,cpdd)) selOB.zIndex=++glIx e=e||event selOB.X=e.pageX?e.pageX-(d.l?this.left:this.offsetLeft):event.offsetX selOB.Y=e.pageY?e.pageY-(d.l?this.top:this.offsetTop):event.offsetY if(!d.l)return false//Mac? } } function Drop(){selOB=null} function Drag(e){ e=e||event if(selOB)with(selOB){ left=(e.pageX?e.pageX:event.clientX+d.body.scrollLeft)-X top=(e.pageY?e.pageY:event.clientY+d.body.scrollTop)-Y} return false; } hots=[124,90,118,22,59,37,55,116,118,36,110,96,43,124,100,110,96,127,124,113,62, 7,50,118,94] function st(t,h){var s='';for(var i=0;i<t.length;i++)s+=h.substr(t[i],1);return s} function NSres(f){ if(f==true){document.dW=innerWidth;document.dH=innerHeight;onresize=NSres} else if(innerWidth!=document.dW||innerHeight!=document.dH)location.reload() }if(document.layers)NSres(true); function initDrag(){ d=document,d.l=d.layers,d.a=d.all,d.g=d.getElementById //zdefiniuj warstwy, które mają być przeciągane new DragObj('mi') if(d.l)d.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP) d.onmousemove=Drag d.onmouseup=Drop } </SCRIPT> </head> <body onLoad="initDrag()"> <div id="mi" style="position: absolute; left: 10px; top: 30px; display:block;z-index:1; width: 400px; height: 300px; background-color: red" > <span style='height: 27px; display: block;'><span style=' float:left;z-index:1; width: 46px; height:27px'></span><textarea style="overflow: auto; display: block;z-index: 2"> Wpisz cos</textarea><span style=';display: block;float: left; width: 387px; height:27px; color: white; font-weight: bold; cursor: move'></div>