社区
JavaScript
帖子详情
如何让用window.open()打开的窗口居中
xhust2000
2004-08-18 02:52:40
我用:
window.open("customer_list1.html","选择列表","scrollbars=no,menubar=no,toolbar=no,width=450,height=400");
window.scrollTo(100,100);
想让窗口居中,但没有起作用,怎么让window.open()打开的窗口居中呢?
...全文
1615
6
打赏
收藏
如何让用window.open()打开的窗口居中
我用: window.open("customer_list1.html","选择列表","scrollbars=no,menubar=no,toolbar=no,width=450,height=400"); window.scrollTo(100,100); 想让窗口居中,但没有起作用,怎么让window.open()打开的窗口居中呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
duoduobaba
2004-08-18
打赏
举报
回复
var popwin=window.open("customer_list1.html","选择列表","scrollbars=no,menubar=no,toolbar=no,width=450,height=400");
//window.scrollTo(100,100);
popwin.moveTo((screen.width-400)/2,(screen.height-450)/2)
xhust2000
2004-08-18
打赏
举报
回复
谢谢你,我刚才继续加了一个属性top='',left=''就可以了,谢谢你
cmslovehxh
2004-08-18
打赏
举报
回复
<!--
<script language="javascript">
if(screen.width=="640")
{
window.open("news.asp","newwindow","height=480, width=405, top=0, left=225, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")
}
else if(screen.width=="800")
{
window.open("news.asp","newwindow","height=480, width=405, top=0, left=385, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")
}
else if(screen.width=="1024")
{
window.open("news.asp","newwindow","height=480, width=405, top=0, left=610, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")
}
</script>
-->
以上是弹出在右上角的。
主要根据窗体跟屏幕大小计算top跟left,top=(screen.height-height)/2 left=(screen.width-width)/2
xhust2000
2004-08-18
打赏
举报
回复
我顶!!!
xhust2000
2004-08-18
打赏
举报
回复
怎么没有人能响应下,哪位大虾给解决了?
xhust2000
2004-08-18
打赏
举报
回复
有哪位能解决,谢谢
window.open
()弹出
居中
的
窗口
window.open
()弹出
居中
的
窗口
window.open
打开
页面
居中
显示的示例代码
1.js 代码如下:[removed] function openwindow(url,name,iWidth,iHeight) { // url 转向网页的地址 // name 网页名称,可为空 // iWidth 弹出
窗口
的宽度 // iHeight 弹出
窗口
的高度 //window.screen.height...
react-new-window:using使用`
window.open
`在React中弹出新
窗口
根据父
窗口
或屏幕使弹出
窗口
居中
。 安装 npm i react-new-window --save 用法 import React from 'react' import NewWindow from 'react-new-window' const Demo = ( ) => ( < NewWindow> < h1> Hi :waving_hand:...
layer.open的自适应及
居中
及子页面标题的修改方法
layer.open的自适应: ...layer.open
居中
: var index1 = layer.load(2, { shade: false });//过渡 //重新定义layer.open的宽 var index = parent.layer.getFrameIndex(window.name); parent.layer.sty
javascript之弹出
窗口
居中
的代码
javascript弹出
窗口
居中
代码 下面给两个弹出屏幕
居中
窗口
的例子 代码如下:
window.open
()方式 function ShowDialog(url) { var iWidth=300; //
窗口
宽度 var iHeight=200;//
窗口
高度 var iTop=(window.screen.height...
JavaScript
87,909
社区成员
224,616
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章