关于window.open的其他使用

81 阅读1分钟
最近大屏开发遇到一个新需求,需要在大屏上边弹出一个第三方网站的新窗口,窗口大小为1920*1080.之所以放在大屏上面,为了能够关掉该窗口后继续浏览大屏界面。

1,打开新窗口全屏

function ow(owurl){  
    var tmp=window.open("about:blank","","fullscreen=1")  
    tmp.moveTo(0,0);  
    tmp.resizeTo(screen.width+20,screen.height);  
    tmp.focus();  
    tmp.location=owurl;  
}
ow("www.baidu.com")

2.打开新窗口以固定尺寸

window.open("www.baidu.com",'target','width=1920,height=1080')