
12/08/2005, 15:13
|
| | Fecha de Ingreso: abril-2005
Mensajes: 92
Antigüedad: 19 años, 10 meses Puntos: 0 | |
Solucion... bueno aqui les dejo la solucion...
ya logre solucionar... como dije solo faltaba una tonteria...
en un if falta colocar un eval solamente... aqui les dejo el script completo y funcionando... si hay alguna duda o mejora no duden en hacerla saber...
Código:
<script language=Javascript>
//cerrar todas las ventanas. Script por tunait!
//http://javascript.tunait.com/
//[email protected]
//Modificado por er_duque
var Ventanas = new Array();
function centrarPopUp(url, width, height, nombre) {
//alert("entro a funcion");
var yes = 1;
var no = 0;
var menubar = no; // The File, Edit, View Menus
var scrollbars = yes; // Horizontal and vertical scrollbars
var locationbar = no; // The location box with the site URL
var directories = no; // the "What's New", "What Cool" links
var resizable = no; // Can the window be resized?
var status = no; // Status bar (with "Document: Done")
var toolbar = no; // Back, Forward, Home, Stop toolbar
var t;
e = false;
for(t = 0; t < Ventanas.length; t++){
if(Ventanas[t]==nombre){
e = true;
if (!eval(Ventanas[t]).closed){
alert("La opcion ya fue abierta.");
eval(Ventanas[t]).focus();
}else{
e = false;
}
break;
}
}
if ( window.screen ) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
var xc = ( aw - width ) / 2;
var yc = ( ah - height ) / 2;
var left = "" + xc + ",screenX=" + xc;
var top = "" + yc + ",screenY=" + yc;
}
features = "" +
"width=" + width + "," +
"height=" + height + "," +
"top=" + top + "," +
"left=" + left + "";
features += "" +
(menubar ? ",menubars" : "") +
(scrollbars ? ",scrollbars" : "") +
(locationbar ? ",location" : "") +
(directories ? ",directories" : "") +
(resizable ? ",resizable" : "") +
(status ? ",status" : "") +
(toolbar ? ",toolbar" : "");
if(!e){
eval(nombre+"=window.open('"+url+"','" + nombre + "','"+features+"')");
Ventanas[Ventanas.length] = nombre;
}
}
function cerrar(){
var m;
for(m=0;m<Ventanas.length;m++){
if(eval(Ventanas[m])){
eval(Ventanas[m]).close()
}
}
Ventanas.length = 0
}
</script>
__________________ Er_Duque |