使用window.open()方式打开新页面,关闭后浏览器不能释放资源,需要等待主界面关闭后才能释放

时间:2022-02-13 14:43:05

一言不合 直接传代码 :)

var openVideo = null;

function openCarVideo(vehType,camIdnum){
var url = rootPath + "/gis/video?vehType="+vehType+"&camIdnum="+camIdnum;
var iWidth=1910; //弹出窗口的宽度; 1260
var iHeight=1070; //弹出窗口的高度;610
//var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置;
var iTop = 0;
var iLeft = 0;
//var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
if(openVideo != null){
openVideo.close();
}else{
openVideo = null;
}
openVideo = window.open(url, "newwindow", "height="+iHeight+", width="+iWidth+", top="+iTop+", left="+iLeft);
openVideo.focus();
}