Foros del Web » Programando para Internet » Javascript »

script de java

Estas en el tema de script de java en el foro de Javascript en Foros del Web. hola! he conseguido un script de java q m permita abrir una nueva página como si fuese una ventana independiente, pero el link con el ...
  #1 (permalink)  
Antiguo 06/02/2003, 12:53
 
Fecha de Ingreso: enero-2003
Ubicación: A Coruña
Mensajes: 76
Antigüedad: 21 años, 3 meses
Puntos: 0
Pregunta script de java

hola!
he conseguido un script de java q m permita abrir una nueva página como si fuese una ventana independiente, pero el link con el que quiero utilizr este script está dentro de un marco, y el script no me permite que esta ventana se vea sobre el otro marco.
El script es el siguiente:
" <script language="JavaScript" type="text/JavaScript">


function crearOpenLayer(nombrevar, _top, _left, _width, _height, _bgColor, _borderColor, _shadowColor, pagina){
eval(nombrevar +"=new OpenLayer(nombrevar, _top, _left, _width, _height, _bgColor, _borderColor, _shadowColor, pagina); "+ nombrevar +".ini();");
}

function OpenLayer(nombrevar, _top, _left, _width, _height, _bgColor, _borderColor, _shadowColor, pagina){
this.nombrevar=nombrevar;
this.id=nombrevar +"_Tag";
if(eval("typeof("+ this.id +")")!='undefined'){
if(eval(nombrevar)) eval(nombrevar+".destroy()")
}
this.idShadow=nombrevar +"_Shadow";
this.anchoSombra=5;
this.top=_top;
this.left=(_left>=0)?_left:((screen.width-_width)/2);
this.bottom=_top+_height; //_bottom;
this.right=_left+_width; //_right;
this.width=_width; //this.right-this.left;
this.height=_height; //this.bottom-this.top;
this.iteraciones=50;
this.escX=parseInt(this.width/this.iteraciones);
this.escY=parseInt(this.height/this.iteraciones);
this.delay=parseInt(1000/this.iteraciones);
this.bgColor=_bgColor;
this.borderColor=_borderColor;
this.shadowColor=(_shadowColor!='')?_shadowColor:" #dddddd";
this.pagina=pagina;
this.zindex=(ultimoZIndex()+2);
document.body.insertAdjacentHTML("BeforeEnd",'<div id="'+ this.id +'" style="position:absolute; left:'+ this.left +'px; top:'+ this.top +'px; width:'+ this.width +'px; height:'+ this.height +'px; z-index:'+ this.zindex+1 +';"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="tablaopenlayer"><tr><td id="'+ this.id +'celda" bgcolor="'+ this.bgColor +'"><iframe id="iframeopenlayer" width="100%" height="100%" scrolling="no" frameborder="0" src="" ></iframe></td></tr></table></div>');
document.body.insertAdjacentHTML("BeforeEnd",'<div id="'+ this.idShadow +'" style="position:absolute; left:'+ (this.left+this.anchoSombra) +'px; top:'+ (this.top+this.anchoSombra) +'px; width:'+ this.width +'px; height:'+ this.height +'px; z-index:'+ (this.zindex-1) +';"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="tablaopenlayer_Shadow"><tr><td id="'+ this.id +'celda_Shadow" bgcolor="'+ this.shadowColor +'"><iframe id="iframeopenlayerShadow" width="100%" height="100%" scrolling="no" frameborder="0" src="" ></iframe></td></tr></table></div>');
this.obj=eval(this.id);
this.objShadow=eval(this.idShadow);
this.celda=eval(this.id +"celda");
this.ini=OL_inicializar;
this.iniV=OL_iniVert;
this.iniH=OL_iniHor;
this.centrar=centrarLayer;
this.destroy=OL_destroy;
return this;
}

function OL_inicializar(){
this.obj.style.height=1;
this.obj.style.width=1;
this.objShadow.style.height=1;
this.objShadow.style.width=1;
with(this.celda.style){
borderColor=this.borderColor;
borderStyle="solid";
borderWidth=1;
}
var IFD=iframeopenlayer.document;
IFD.write('<html><frameset rows=13,* cols=* framespacing=0 frameborder=no border=0><frame scrolling=no name=topFrame scrolling=NO noresize ><frame name=mainFrame scrolling=no></frameset><noframes><body></body></noframes></html>');
IFD.frames.topFrame.document.write('<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td id=celdatopframe><div align=right><a id="topframecerrar" href="#" onclick="window.parent.parent.'+ this.nombrevar +'.destroy();"><font size=1 color="'+ this.bgColor +'"><b>&nbsp;X&nbsp;</b></font></a></div></td></tr></table></body>');
IFD.frames.mainFrame.document.location= this.pagina ;
IFD.frames.topFrame.celdatopframe.style.borderBott omStyle='solid';
IFD.frames.topFrame.celdatopframe.style.borderBott omWidth=1;
IFD.frames.topFrame.celdatopframe.style.borderBott omColor= this.borderColor;
IFD.frames.topFrame.celdatopframe.style.background Color= this.bgColor ;
IFD.frames.topFrame.topframecerrar.style.backgroun dColor= this.borderColor ;
IFD.frames.topFrame.topframecerrar.style.textDecor ationNone= true ;
IFD.frames.topFrame.topframecerrar.style.fontFamil y="Verdana" ;
iframeopenlayerShadow.document.write('<html><body bgcolor="'+ this.shadowColor +'"></body></html>');
this.iniV();
this.iniH();
}

function OL_iniVert(objOL){
var t=(objOL)?objOL:this;
var ob=t.obj;
var obS=t.objShadow;
with(ob.style){
height=nrolayer(height) + t.escY;
obS.style.height=nrolayer(obS.style.height) + t.escY;
if(nrolayer(height)<t.height){
setTimeout('OL_iniVert('+ t.nombrevar +')', t.delay);
}else{
// alert(t.height);
height=t.height;
}
t.centrar();
}
}

function OL_iniHor(objOL){
var t=(objOL)?objOL:this;
var ob=t.obj;
var obS=t.objShadow;
with(ob.style){
width=nrolayer(width) + t.escX;
obS.style.width=nrolayer(obS.style.width) + t.escX;
if(nrolayer(width)<t.width){
setTimeout('OL_iniHor('+ t.nombrevar +')', t.delay);
}else{
width=t.width;
}
t.centrar();
}
}

function centrarLayer(){
var w=this.width;
var h=this.height;
var o=this.obj;
var oS=this.objShadow;
LeftPosition =parseInt( (w) ? (w-nrolayer(o.style.width))/2 : 0)+this.left;
TopPosition =parseInt( (h) ? (h-nrolayer(o.style.height))/2 : 0)+this.top;
o.style.top=TopPosition;
o.style.left=LeftPosition;
oS.style.top=TopPosition+this.anchoSombra;
oS.style.left=LeftPosition+this.anchoSombra;
}

function nrolayer(p){ return eval(p.replace("px", ""))}

function OL_destroy(){
this.obj.style.visibility='hidden';
this.obj.outerHTML='';
this.objShadow.style.visibility='hidden';
this.objShadow.outerHTML='';
eval(this.nombrevar +"=null;");
}

function ultimoZIndex(){
var ultimo=0;
var zidx;
var divs=document.all.DIV;
if(divs){
for(var i=0; i<divs.length; i++){
zidx=nrolayer(divs[i].style.zindex);
if(zidx>ultimo) ultimo=zidx;
}
}
return ultimo;
}

</script>"
Si alguien me puede decir como especifico que esta ventana se superponga al marco inferior de una página se lo agradeceré eternamente.
Gracias, es urgente
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:12.