var popwin;
if(screen.width=="640")
{
popwin = window.open("s1.html","name","resizable=yes,scrollbars=no,menubar=no,toolbar=no,width=450,height=400");
}
else if(screen.width=="800")
{
popwin = window.open("s1.html","name","resizable=yes,scrollbars=no,menubar=no,toolbar=no,width=450,height=400");
}
else if(screen.width=="1024")
{
popwin = window.open("s1.html","name","resizable=yes,scrollbars=no,menubar=no,toolbar=no,width=450,height=400");
}
//重新设置窗口大小
popwin.resizeTo("550","500");
//网页正文全文宽
pw = popwin.document.documentElement.scrollWidth-4;
//网页正文全文高
ph = popwin.document.documentElement.scrollHeight-4;
//移动窗口到中心位置
popwin.moveTo((screen.width-pw)/2,(screen.height-ph)/2);
分享到:
相关推荐
Web开发中的window.open父子窗口传值问题 部署在tomcat中进行
主要讲解了如何利用window.open打开新窗口,和打开新窗口时的一些参数的设置,很实用的。
弹出窗口,并且弹出窗口要求最大化处理,window.open打开的窗口获取到焦点
window.open打开新窗口,不被拦截的方法
当在网页中用javascript winow.open 打开一个新窗口后,是否能在你窗口中调用并执行新窗口中的代码或调取其中的元素? 答案是肯定的。 这段示例代码不但能在父窗口页面test.html中执行被打开的新窗口页面test-open...
对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...
Window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。 这一段代码...
扩展window.open方法,使得window.open时针对相同的URL地址非打开新窗口,而是仅仅激活已存在窗口,另外,此激活不会刷新页面,不会丢失页面上已存在的数据
windows.open这个是JavaScript函数,但是在应用起来的时候总会遇到比较多的麻烦,因为参数非常多,用法也非常的多
[removed] var timer var winOpen function IfWindowClosed() { if (winOpen.closed == true) { document.fm_Info.txtValue.value=”child closed” window.clearInterval(timer) } } [removed] <input type=b
window.showModalDialog以及window.open用法简介
window.open使用方法以及参数说明一、window.open()支持环境: JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二、基本语法: window.open(pageURL,name,parameters) 其中: pageURL 为子窗口路径 name 为子窗口...
window.open()弹出居中的窗口
NULL 博文链接:https://shawnfree.iteye.com/blog/598885
关于window.open的一些特性,一些你经常不注意的,值的一看啊
一、window.open()支持环境: 二、基本语法: 三、示例: 四、各项参数
window.open()参数大全,window.open()参数大全,window.open()参数大全。
弹出窗口,并且弹出窗口要求最大化处理,window.open打开的窗口获取到焦点
window.showModalDialog以及window.open用法简介
window.open参数详解.txt