Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2003, 18:10
rbczgz
 
Fecha de Ingreso: noviembre-2003
Ubicación: Zaragoza, España
Mensajes: 1.257
Antigüedad: 20 años, 5 meses
Puntos: 154
¿Cómo abro un popup desde un javascript?

Hola amig@s!!

Necesito resolver un problema que tengo con este menú:



<script languaje="javascript>
// Añadir esto justo encima de </head> -->
IE=document.all;
NS=document.layers;
/*
Configure menu styles below
NOTE: To edit the link colors, go to the STYLE tags and edit the ssm2Items colors
*/
hdrFontFamily="Arial Black";
hdrFontSize="3";
hdrFontColor="#FFFFCC";
hdrBGColor="#993366";
linkFontFamily="Arial Black";
linkFontSize="2";
linkFontColor="#FFFFCC";
linkBGColor="#ffffff";
linkOverBGColor="#C0C0C0";
linkTarget="_parent";
YOffset=40;
staticYOffset=20;
menuBGColor="#993366";
menuIsStatic="yes";
menuHeader=" Menu de Mi sitio We"
menuWidth=180; // Must be a multiple of 5!
staticMode="advanced"
barBGColor="#993366";
barFontFamily="Arial Black";
barFontSize="3";
barFontColor="#FFFFCC";
barText="Pasar el puntero";

function moveOut() {
if (window.cancel) {cancel="";}
if (window.moving2) {clearTimeout(moving2); moving2="";}
if ((IE && ssm2.style.pixelLeft<0)||(NS && document.ssm2.left<0)) {
if (IE) {ssm2.style.pixelLeft += (5%menuWidth);}
if (NS) {document.ssm2.left += (5%menuWidth);}
moving1 = setTimeout('moveOut()', 10)}
else {clearTimeout(moving1)}};
function moveBack() {
cancel = moveBack1()}
function moveBack1() {
if (window.moving1) {clearTimeout(moving1)}
if ((IE && ssm2.style.pixelLeft>(-menuWidth))||(NS && document.ssm2.left>(-140))) {
if (IE) {ssm2.style.pixelLeft -= (5%menuWidth);}
if (NS) {document.ssm2.left -= (5%menuWidth);}
moving2 = setTimeout('moveBack1()', 10)}
else {clearTimeout(moving2)}};

lastY = 0;
function makeStatic(mode) {
if (IE) {winY = document.body.scrollTop;var NM=ssm2.style}
if (NS) {winY = window.pageYOffset;var NM=document.ssm2}
if (mode=="smooth") {
if ((IE||NS) && winY!=lastY) {
smooth = .2 * (winY - lastY);
if(smooth > 0) smooth = Math.ceil(smooth);
else smooth = Math.floor(smooth);
if (IE) NM.pixelTop+=smooth;
if (NS) NM.top+=smooth;
lastY = lastY+smooth;}
setTimeout('makeStatic("smooth")', 1)}
else if (mode=="advanced") {
if ((IE||NS) && winY>YOffset-staticYOffset) {
if (IE) {NM.pixelTop=winY+staticYOffset}
if (NS) {NM.top=winY+staticYOffset}}
else {
if (IE) {NM.pixelTop=YOffset}
if (NS) {NM.top=YOffset-7}}
setTimeout('makeStatic("advanced")', 1)}}

function init() {
if (IE) {
ssm2.style.pixelLeft = -menuWidth;
ssm2.style.visibility = "visible"}
else if (NS) {
document.ssm2.left = -menuWidth;
document.ssm2.visibility = "show"}
else {alert('Choose either the "smooth" or "advanced" static modes!')}}

//-->

</script>


</head>



// Cambiar la etiqueta <body> por:-->
//<BODY bgcolor="#edeee0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="5" onLoad="init()">
// Añadir esto justo debajo: -->
if (IE) {document.write('<DIV ID="ssm2" style="visibility:hidden;Position : Absolute ;Left : 0px ;Top : '+YOffset+'px ;Z-Index : 20;width:1px" onmouseover="moveOut()" onmouseout="moveBack()">')}
if (NS) {document.write('<LAYER visibility="hide" top="'+YOffset+'" name="ssm2" bgcolor="'+menuBGColor+'" left="0" onmouseover="moveOut()" onmouseout="moveBack()">')}
tempBar=""
for (i=0;i<barText.length;i++) {
tempBar+=barText.substring(i, i+1)+"<BR>"}
document.write('<table border="1" cellpadding="0" cellspacing="1" width="'+(menuWidth+16+2)+'" bgcolor="'+menuBGColor+'"><tr><td bgcolor="'+hdrBGColor+'" WIDTH="'+menuWidth+'"> <font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+menuHeader+'</b></font></td><td align="center" rowspan="100" width="16" bgcolor="'+barBGColor+'"><p align="center"><font face="'+barFontFamily+'" Size="'+barFontSize+'" COLOR="'+barFontColor+'"><B>'+tempBar+'</B></font></p></TD></tr>')
function addItem(text, link, target) {
if (!target) {target=linkTarget}
document.write('<TR><TD BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'"><ILAYER>< LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%"><FONT face="'+linkFontFamily+'" color="'+linkFontColor+'" Size="'+linkFontSize+'"> <A HREF="'+link+'" target="'+target+'" CLASS="ssm2Items">'+text+'</LAYER></ILAYER></TD></TR>')}
function addHdr(text) {
document.write('<tr><td bgcolor="'+hdrBGColor+'" WIDTH="120"> <font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+text+'</b></font></td></tr>')}

//Only edit the script between HERE

addItem('Título', 'http://www.dominio.com/index.html', '');
addItem('Título2', 'http://www.dominio.com/2.html', '');
addItem('Título3', 'http://www.dominio.com/3.html', '');
addItem('Título4', 'http://www.dominio.com/4.html', '');
addItem('Popup1', 'http://www.dominio.com/5.html', '');
addItem('Popup2', 'http://www.dominio.com/6.html', '');
// and HERE! No more!

document.write('<tr><td bgcolor="'+hdrBGColor+'"><font size="2" face="Arial Black"> </font></td></TR></table>')
if (IE) {document.write('</DIV>')}
if (NS) {document.write('</LAYER>')}
if ((IE||NS) && (menuIsStatic=="yes"&&staticMode)) {makeStatic(staticMode);}
</script>


Lo que necesito es saber cómo abrir un popup desde este menú, porque tal como está abre todo en la misma página, además el popup debe ser sin barra de estado, scroll, dirección ... Vamos sólo la ventana y para más colmo centrada .

Espero que alguien me pueda ayudar porque además me corre mucha prisa (lo quieren para YA ).

Muchas gracias por anticipado.

Rubén