怎样让弹出对话框居中显示
2007-06-26 02:08
253 查看
方法一:
<script>
function opW(){
var ye=window.open('','yexj00','width=400,height=200');
ye.moveTo((screen.availWidth-400)/2,(screen.availHeight-200)/2);
}
</script>
<input type=button value=打开居中的新窗口 hideFocus=true
有移动延迟
方法二:
ShowDialog(url)
{
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(screen.height-iHeight)/2;
var iLeft=(screen.width-iWidth)/2;
open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
}
这个比较好
<script>
function opW(){
var ye=window.open('','yexj00','width=400,height=200');
ye.moveTo((screen.availWidth-400)/2,(screen.availHeight-200)/2);
}
</script>
<input type=button value=打开居中的新窗口 hideFocus=true
有移动延迟
方法二:
ShowDialog(url)
{
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(screen.height-iHeight)/2;
var iLeft=(screen.width-iWidth)/2;
open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
}
这个比较好
相关文章推荐
- 怎样让弹出对话框居中显示
- Qt 关于弹出对话框,实现居中显示!
- 弹出对话框的同时保持页面的显示
- window.location.reload()方法刷新页面弹出要再次显示该网页对话框
- MFC对话框隐藏及显示居中
- 自定义弹出层居中并显示遮罩
- 用JavaScript弹出的alert对话框中如何实现显示信息的换行
- 使弹出div的文职居中显示
- 怎样不显示初始对话框?
- 居中显示弹出窗口(兼容IE和Chrome)
- JS实现始终居中显示的对话框
- 对话框命令更新怎样先于对话框显示菜单项
- JavaScript-2.内置对象---简单脚本之弹出对话框显示当前时间 ---ShinePans
- JavaScript基础 window.open(url,name,options) 弹出一个 新窗口 屏幕居中显示 获取屏幕的有效宽度
- 深入分析:怎样从一个对话框弹出单文档视图
- jquery 弹出框居中显示
- 弹出菜单中用Domodal显示模态对话框,对话框得不到鼠标消息
- 【解决方案Webview】H5弹出对话框,部分机型显示错位问题!
- 怎样显示子对话框标题栏上的图标