JavaScript - Problemas con Prototype Windows

   
Vista:

Problemas con Prototype Windows

Publicado por everth (1 intervención) el 03/12/2012 02:40:12
Hola, espero me ayuden.

En mi proyecto de clase de Diseño de Internet quiero mostrar ventanas en un div al momento de hacer clic en un "ul", la cual llama a la funcion javascript "win1"

Pero me muestra el siguiente error:

"Window win1 is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor"


Este es mi código:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<link href="../twoColFixLtHdr.css" rel="stylesheet" type="text/css" />
 
 
<link rel="stylesheet" type="text/css" href="../script/jquery-ui-1.9.2.custom/jquery-ui-1.9.2.custom/css/custom-theme/jquery-ui-1.9.2.custom.min.css"/>
<link rel="stylesheet" type="text/css" href="../script/jquery-ui-1.9.2.custom/jquery-ui-1.9.2.custom/css/custom-theme/jquery-ui-1.9.2.custom.css"/>
 
<link rel="stylesheet" type="text/css" href="../script/jquery-treeview-1.4.1-0/jquery.treeview.css"/>
 
 
<link rel="stylesheet" type="text/css" href="../script/windows_js_1.3/themes/default.css"/>
<link rel="stylesheet" type="text/css" href="../script/windows_js_1.3/themes/alphacube.css"/>
 
 
 
<style type="text/css">
    .popup_effect1 {
      background:#11455A;
      opacity: 0.2;
    }
    .popup_effect2 {
     background:#FF0041;
     border: 3px dashed #000;
    }
 
  </style>
 
 
<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
 
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/prototype.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/effects.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/window.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/window_effects.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/window_ext.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/debug.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/extended_debug.js"></script>
<script type="text/javascript" src="../script/windows_js_1.3/javascripts/tooltip.js"></script>
 
 
<script type="text/javascript" src="../script/jquery-ui-1.9.2.custom/jquery-ui-1.9.2.custom/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="../script/jquery-ui-1.9.2.custom/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript" src="../script/jquery-ui-1.9.2.custom/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"></script>
 
<script type="text/javascript" src="../script/jquery-treeview-1.4.1-0/jquery.treeview.js"></script>
 
 
 
<script type="text/javascript">
//para el acordión
var x = $(document);
x.ready(function(e) {
    var x = $("#accordion");
	x.accordion();
});
var x = $(document);
x.ready(function(e) {
    var x = $("#browser");
	x.treeview({
	 	//persist: "cookie",
	    cookieId: "filetree"
});
});
 
 
function win1(html) {
var win = new Window({url: "http://www.google.com",id:"win1",className: "alphacube",parent:$('contenedor'),title: "Ventana", width:400, height:400, top:0, left: 1, }).showCenter()
WindowCloseKey.init();
 win.getContent().innerHTML = "<h1>Constraint inside  a div !!</h1>constraint: {left:10, right:20}<br><a href='#' onclick='Windows.getWindow(\"win1\").maximize()'>Maximize me</a>";
 win.setConstraint(true, {left:10, right:20})
  win.toFront();
}
</script>
 
 
 
 
 
</head>
 
<body>
 
<div class="container">
  <div class="header"><a href="#"><img src="" alt="Insertar logotipo aquí" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background-color: #C6D580; display:block;" /></a>
    <!-- end .header -->/div>
  <div class="sidebar1">
 
  <div id="accordion">
 
  <h3>Personal</h3>
   <div >
  	<ul id="browser" class="filetree">
        <li><span class="folder">Nuevo</a></span>
            <ul onclick= "win1(this)">
              <li><span class="file">Empleado</span></li>
          </ul>
        </li>
        <li><span class="folder">Editar</a></span>
            <ul>
              <li><span class="file">Empleado</span></li>
          </ul>
        </li>
     </ul>
 
    </div>
 
     <h3>Producto</h3>
   <div >
  	<ul class="filetree">
        <li><span class="folder">Nuevo</a></span>
            <ul>
              <li><span class="file">Producto</span></li>
          </ul>
        </li>
        <li><span class="folder">Editar</a></span>
            <ul>
              <li><span class="file">Producto</span></li>
          </ul>
        </li>
     </ul>
 
    </div>
 
    </div>
    <!-- end .sidebar1 -->/div>
  <div id="contenedor" class="content" >
    <h1><!-- TemplateBeginEditable name="EditRegion1" -->teEndEditable --><!-- end .content --></h1>
  </div>
  <div class="footer">
    <p>&nbsp;</p>
  <!-- end .footer -->t;/div>
  <!-- end .container -->t;/div>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder