jquery.windows-engine - 尝试从另一个窗口打开一个窗口时出现问题

时间:2009-09-28 01:59:15

标签: javascript jquery

当我尝试从另一个窗口打开窗口时,找不到它。

jQuery的Windows的引擎 - 插件

谢谢!

<html>
<head>
<title>Test</title>

<link type="text/css" rel="stylesheet" href="jquery.windows-engine.css" />
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript" src="jquery.windows-engine.js"></script>
<script type="text/javascript">

$(document).ready(function() {
 $("#menu").newWindow({
   windowTitle:"menu",
   content: "<ahref='#' id='example2' >Example 2</a>           Here",
   width:160,height:230,posx:10,posy:120,
 }); 
 $("#example2").newWindow({
  windowTitle:"Example1", 
  content: "example2",
  posx:200,posy:100,
  resizeable:false, maximizeButton:false,
 });   
});
</script>
</head>
<body>
<div>
 <ahref="#" id="menu" >menu</a><br/> 
 <ahref="#" id="example2" >Example 2</a><br/>
</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

对于使用此库(js.windows-engine)的任何人来说,这里的主要问题是对象不是在div上创建的,而是在原始窗口本身上创建的。在这种情况下,用户需要在单击中包装它。例如:

$("#menu").click(function(){
        $.newWindow({
           windowTitle:"menu",
           content: $("#example2").html(),
           width:160,
           height:230,
           posx:10,
           posy:120,
         }); 
    });

Here is a JS Fiddle with the completed solution