Ver Mensaje Individual
  #15 (permalink)  
Antiguo 08/07/2008, 10:49
Avatar de gepd
gepd
 
Fecha de Ingreso: diciembre-2007
Mensajes: 142
Antigüedad: 16 años, 5 meses
Puntos: 6
Respuesta: Propuesta Depuración de Códigos, No Librerias!

caricatos corrigiendo lo que me has dicho he modificado el código pero no logro que me cree los div, a continuacion te dejo la modificación.

Código PHP:
function tag(id)    {return document.getElementById(id);}
function 
crear(e)    {return document.createElement(e);}
function 
texto(t)    {return document.createTextNode(t);}
function 
generaDiv(ide,color,opacity,ancho,alto,msj){
    var 
navegador=1;
    if(
navigator.userAgent.indexOf("MSIE")>=0navegador=0;
        var 
layer crear('div');
        
with(layer){
            
id=ide;
            
style.width='100%';
            
style.height='100%';
            
style.backgroundColor=color;
            
style.position='absolute';
            
style.top=0;
            
style.left=0;
            
style.zIndex=100;
            if(
navegador==0style.filter='alpha(opacity='+opacity+')';
            else 
style.opacity=opacity/100;
        }
            
document.body.appendChild(layer);
        var 
wds=crear('div');
        
with(wds){
            
id=ide+ide;
            
style.position="absolute";
            
style.width=ancho+"px";
            
style.height=alto+"px";
            
style.top="50%";
            
style.left="50%";
            
style.marginLeft=(-ancho/2)+"px";
            
style.marginTop=(-alto/2)+"px";
            
style.backgroundColor="#FFFFFF";
            
style.textAlign="center";
            
style.zIndex=200;
            
innerHTML=msj;
        }
        var 
div tag(ide);
            
div.appendChild(wds); 
luedo de probar y probar, vi que no puedo hacer
with(style){
parametro;
}
al ahcerlo deja de funcionar el codigo.

así que hasta el momento va así

Saludos

Última edición por gepd; 08/07/2008 a las 15:04