Ok, this is my problem: I have the code listed below, the objective is to
make some little windows that you can minimize, maximize and close, and
reopen if you click the links on the left. It works in IE 5.0 (without
problems), and in Netscape 4.5... if you only use them once, but if you
close a little window in netscape and then you try to reopen it, it doesn't
work at all, the child layer doesn't appear and you can't close the window
again.

I've tried some changes in the code but I'm not a programmer so it's very
difficult to me to find what's wrong (maybe there is a problem when I
destroy the layers). Can anybody help me?
Thanks in advance.
:)

(I'm sorry for my english, I know it isn't as correct as it should be but I
hope you have understood me )

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

<Script language="Javascript" src="../src/dynapi.js"></script>
<Script language="Javascript">

DynAPI.setLibraryPath('../src/lib/')

DynAPI.include('dynapi.api.*')

function MakeLayer(n){

 switch (n)
 {
  case 1:

 ventana1 = new DynLayer(null,100,100,200,200,'#6699FF')

 ventana1.setHTML('<TABLE width="100%" border=1 bordercolor="#000000"
cellpading="0" cellspacing="0"><TR align="right"><TD><a href="#"
onClick="ventana1.setSize(200,21)"><IMG SRC="min.gif" WIDTH="16" HEIGHT="16"
BORDER=0 hspace="2"></a><a href="#" onClick="ventana1.setSize(200,200)
"><IMG SRC="max.gif" WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a><a
href="#" onClick="ventana1.deleteFromParent()"><IMG SRC="cerrar.gif"
WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a></TD></TR></TABLE>')

 DynAPI.document.addChild(ventana1);

 arrastre1 = new DynLayer(null,0,20,200,180,'#66CCFF')
  arrastre1.setHTML('<TABLE width="100%" height="180" border=1
bordercolor="#000000" cellpading="0" cellspacing="0"><TR
align="center"><TD><font face="verdana" size="1" color="#000000"><b>VENTANA
<br><br> Aquí va el texto que te de la gana, imágenes, tablas, enlaces,
etc</b></font></TD></TR></TABLE>')

 ventana1.addChild(arrastre1)

 DragEvent.setDragBoundary(ventana1)
 DragEvent.enableDragEvents(ventana1)

 myListener1 = new EventListener(DynAPI.document)
  myListener1.onmousedown=function(e) {
   e.setBubble(false)
  }
 arrastre1.addEventListener(myListener1);

  break;

  case 2:

 ventana2 = new DynLayer(null,100,100,250,250,'#00CCCC')

 ventana2.setHTML('<TABLE width="100%" border=1 bordercolor="#000000"
cellpading="0" cellspacing="0"><TR align="right"><TD><a href="#"
onClick="ventana2.setSize(250,21)"><IMG SRC="min.gif" WIDTH="16" HEIGHT="16"
BORDER=0 hspace="2"></a><a href="#" onClick="ventana2.setSize(250,250)
"><IMG SRC="max.gif" WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a><a
href="#" onClick="ventana2.deleteFromParent()"><IMG SRC="cerrar.gif"
WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a></TD></TR></TABLE>')

 DynAPI.document.addChild(ventana2);

 arrastre2 = new DynLayer(null,0,20,250,230,'#99FFCC')
  arrastre2.setHTML('<TABLE width="100%" height="230" border=1
bordercolor="#000000" cellpading="0" cellspacing="0"><TR
align="center"><TD><font face="verdana" size="1" color="#000000"><b>VENTANA
<br><br> Mira esta que gonita, es vedde y más
grande</b></font></TD></TR></TABLE>')

 ventana2.addChild(arrastre2)

 DragEvent.setDragBoundary(ventana2)
 DragEvent.enableDragEvents(ventana2)

 myListener2 = new EventListener(DynAPI.document)
  myListener2.onmousedown=function(e) {
   e.setBubble(false)
  }
 arrastre2.addEventListener(myListener2);

  break;

  case 3:

 ventana3 = new DynLayer(null,100,100,250,250,'#336699')

 ventana3.setHTML('<TABLE width="100%" border=1 bordercolor="#000000"
cellpading="0" cellspacing="0"><TR align="right"><TD><a href="#"
onClick="ventana3.setSize(250,21)"><IMG SRC="min.gif" WIDTH="16" HEIGHT="16"
BORDER=0 hspace="2"></a><a href="#" onClick="ventana3.setSize(250,250)
"><IMG SRC="max.gif" WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a><a
href="#" onClick="ventana3.deleteFromParent()"><IMG SRC="cerrar.gif"
WIDTH="16" HEIGHT="16" BORDER=0 hspace="2"></a></TD></TR></TABLE>')

 DynAPI.document.addChild(ventana3);

 arrastre3 = new DynLayer(null,0,20,250,230,'#66CCCC')
  arrastre3.setHTML('<TABLE width="100%" height="230" border=1
bordercolor="#000000" cellpading="0" cellspacing="0"><TR
align="center"><TD><font face="verdana" size="1" color="#000000"><b>VENTANA
<br><br> A ver si funciona</b></font></TD></TR></TABLE>')

 ventana3.addChild(arrastre3)

 DragEvent.setDragBoundary(ventana3)
 DragEvent.enableDragEvents(ventana3)

 myListener3 = new EventListener(DynAPI.document)
  myListener3.onmousedown=function(e) {
   e.setBubble(false)
  }
 arrastre3.addEventListener(myListener3);

  break;
 }

}

</script>

</HEAD>

<BODY bgcolor="#FFFFCC" link="#FF6600" vlink="#FF6600">
<br>
<a href="javascript:MakeLayer(1)"><font face="verdana" size="1"><b>Abrir
ventana 1</b></font></a><br>
<a href="javascript:MakeLayer(2)"><font face="verdana" size="1"><b>Abrir
ventana 2</b></font></a><br>
<a href="javascript:MakeLayer(3)"><font face="verdana" size="1"><b>Abrir
ventana 3</b></font></a>
</BODY>
</HTML>



_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to