Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/08/2008, 14:24
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años, 5 meses
Puntos: 834
Respuesta: Mover ventana

Con una pequeña modificación entonces (tratá de entender cómo funciona):
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>test</title>
<
style
#container{
    
position:absolute;
    
left:274px
    
top:72px
}
#ventana_t {
    
position:relative;
    
width:216px
    
    
visibility:;
    
height319px;
}
.
barra_ventana {
    
background-color#DDDDDD;
    
border1px solid #999999;
}

#prop_it {
    
background-color#F8F8F8;
    
border1px solid #666666;
}
</
style

<
script>
//inicio lib
function $(id){
    return 
document.getElementById(id);    
}
function 
addEvent(objevTypefnuseCapture){
 
 if (
obj.addEventListener){
    
obj.addEventListener(evTypefnuseCapture);
    
  } else if (
obj.attachEvent){
      
obj[fn+evType]=fn;
    
obj[fn+evType+'n']=function(){obj[fn+evType](window.event);}
    
obj.attachEvent("on"+evTypeobj[fn+evType+'n']);
   
  } else {
   
obj['on'+evType]=fn;
  }
}

function 
removeEvent(objevTypefnuseCapture){
  if (
obj.removeEventListener){
    
obj.removeEventListener(evTypefnuseCapture);
  } else if (
obj.detachEvent){
    
obj.detachEvent("on"+evTypeobj[fn+evType+'n']);
    
obj[fn+evType+'n']=null;
  } else {
    
obj['on'+evType]=function(){};
  }
}

function 
stopEvent(e) {
    if (!
ewindow.event;
    if (
e.stopPropagation) {
        
e.stopPropagation();
    } else {
        
e.cancelBubble true;
    }
}
function 
cancelEvent(e) {
    if (!
ewindow.event;
    if (
e.preventDefault) {
        
e.preventDefault();
    } else {
        
e.returnValue false;
    }
}



function 
getNextHighestDepth(){
    var 
tCol=document.getElementsByTagName('*');
    var 
z=0;
        for(var 
i=0;i<tCol.length;i++){
            if(
tCol[i].style.zIndex>z){
                
z=tCol[i].style.zIndex;
            }
            
        }
    return ++
z;
}

//fin lib

arrastrable={};

function 
mover(e){
    
arrastrable.c2x=e.clientX;
    
arrastrable.c2y=e.clientY;
    
this.parentNode.parentNode.parentNode.style.left=arrastrable.c2x-arrastrable.c1x+arrastrable.o1x+'px';
    
this.parentNode.parentNode.parentNode.style.top=arrastrable.c2y-arrastrable.c1y+arrastrable.o1y+'px';
    
cancelEvent(e);
    
stopEvent(e);
}

function 
detener(){
    
removeEvent(this'mousemove'moverfalse);
    
removeEvent(this'mouseup'detenerfalse);
}

function 
i(e){
    if(
this.parentNode.parentNode.parentNode.position!="relative"||!this.parentNode.parentNode.parentNode.style.position){
        
this.parentNode.parentNode.parentNode.style.position="relative";
        
this.parentNode.parentNode.parentNode.style.cssFloat="none";
        
this.parentNode.parentNode.parentNode.style.zIndex=getNextHighestDepth();
    }
    
arrastrable.c1x=e.clientX;
    
arrastrable.c1y=e.clientY;
    
arrastrable.o1x=!isNaN(parseInt(this.parentNode.parentNode.parentNode.style.left))?parseInt(this.parentNode.parentNode.parentNode.style.left):0;
    
arrastrable.o1y=!isNaN(parseInt(this.parentNode.parentNode.parentNode.style.top))?parseInt(this.parentNode.parentNode.parentNode.style.top):0;
    
addEvent(this'mousemove',moverfalse);
    
addEvent(this'mouseup',detenerfalse);
    
addEvent(this'mouseout',detenerfalse);
    
cancelEvent(e);
    
stopEvent(e);
}

function 
makeDraggable(){
    for(var 
j=0;j<arguments.length;j++){
        $(
arguments[j]).style.cursor='move';
        
addEvent($(arguments[j]), 'mousedown',ifalse);
    }
}
function 
cerrar_VET(){
    $(
'ventana_t').style.visibility="hidden";
}

window.onload=function(){
    
makeDraggable('esto');
}
</script>
</head>

<body>
<div id="container">
<div id="ventana_t">
<table border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr id="esto">
    <td height="11"><img src="Images/Ventana/derecha_ventana.gif" alt="-" width="10" height="30" /></td>
    <td background="Images/Ventana/barra_ventana.gif"><span style="color: #FFFFFF; font-weight: bold; font-family:Arial, Helvetica, sans-serif;">Propiedades</span></td>
    <td  background="Images/Ventana/barra_ventana.gif"><a href="#" onClick="cerrar_VET();"><img src="Images/Ventana/cerrar_ventana.gif" alt="Clic para cerrar" width="100" height="25" border="0" /></a></td>
    <td ><img src="Images/Ventana/izquierda_ventana.gif" alt="-" width="10" height="30" /></td>
  </tr>
  <tr class="barra_ventana">
    <td colspan="4" valign="top" id="prop_it"><br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br /></td>
  </tr>
</table></div></div>
</body>
</html>