treeview 中window。open()问题
本人编写了一段关于treeview的客户端脚本,打开一个新的窗口,但打开后的窗口却是显示在后面,有什么办法使新打开的窗口显示在最前面,其它按纽打开的窗口都是显示在最前面的.有什么办法呢?
代码如下:
function Tree_Click()
{
FolderID = tvContent.getTreeNode(tvContent.clickedNodeIndex).getAttribute("ID");
if (FolderID.substring(0,5) == "Works")
{
tmpwin = window.open("./flow/flow_AddNew.aspx?flowmodelid=1001","新流程" + opencount++,"scrollbars=yes,resizable=yes,top=0,left=0,width="+(window.availWidth-12)+",height="+(window.availHeight-35));
window.Content.tvContent.blur();
if(tmpwin != null)
tmpwin.focus();
}
}
------解决方案--------------------tmpwin.opener.blur();
tmpwin.focus();
------解决方案-------------------- function Tree_Click()
{
FolderID = tvContent.getTreeNode(tvContent.clickedNodeIndex).getAttribute("ID");
if (FolderID.substring(0,5) == "Works")
{
tmpwin = window.open("./flow/flow_AddNew.aspx?flowmodelid=1001","新流程" + opencount++,"scrollbars=yes,resizable=yes,top=0,left=0,width="+(window.availWidth-12)+",height="+(window.availHeight-35));
tmpwin.focus();
}
}
------解决方案--------------------加一个 return false; 触发时用 return