再次操作(a)时(b)将隐藏在后面之后,你想在(a)页面中让(b)页面获得焦点成为当前窗口?

解决方案 »

  1.   

    objWindowName.focus()让(b)页面获得焦点成为当前窗口,其中objWindowName为(b)窗口打开时定义的句柄
      

  2.   

    我想让所有打开的窗口的焦点都放在某一个页面,<button onclick="popo1.focus()">聚焦POPO1</button><button onclick="popo2.focus()">聚焦POPO2</button><button onclick="popo3.focus()">聚焦POPO3</button>
    动态增加popo1.focus()
      

  3.   

    检测子窗口的closed就可以了哦
      

  4.   

    引用:
    ***********************
    我想让所有打开的窗口的焦点都放在某一个页面,<button onclick="popo1.focus()">聚焦POPO1</button><button onclick="popo2.focus()">聚焦POPO2</button><button onclick="popo3.focus()">聚焦POPO3</button>
    动态增加popo1.focus()
    ************************
    可以呀。
    你只要把打开新窗口写在一个方法里。这个方法把窗口存在一个全局变量里,每新打一个或都更新最下面的 子窗口列表。或者作个setInterval() 监测子窗口是否关闭,并更新子窗口的列表
      

  5.   

    做了一个打开一个子窗口的给你看效果<a href="javascript:openit('http://www.sohu.com')">sohu.com</a>
    <script>
    var obj
    var i=0
    function openit(url){
    obj=window.open(url,"obj")
    if(document.all.a1==null){
    nod=document.createElement("BUTTON")
    document.body.insertBefore(nod);
    nod.outerHTML="<button id=a1 onclick=obj.focus()>Focus Sohu.com</button>"
    }
    }
    window.onfocus=function(){
    if(document.all.a1!=null)
    if(obj.closed==true)
    a1.removeNode(true)
    }
    </script>