JS实现windows.open打开窗口并居中
function openWin() {
var url='Add.aspx'; //转向网页的地址;
var name='add'; //网页名称,可为空;
var iWidth=720; //弹出窗口的宽度;
var iHeight=600; //弹出窗口的高度;
//获得窗口的垂直位置
var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
//获得窗口的水平位置
var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight
+ ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop +
',left=' + iLeft +
',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
// window.open("AddScfj.aspx", "newWindows",
'height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,
resizable=no,location=no, status=no');
}
最新文章
- .NET LINQ 投影运算
- 第一章 删掉centos原有的openjdk并安装sun jdk
- 新平台,新版本,ComponentOne 持续发力
- MySQL数据库的基本数据类型
- Javascript写入txt和读取txt文件示例
- Report_矩阵报表的实现(案例)
- poj1942 Paths on a Grid
- LNMP环境下压力测试时的主要调试参数
- (搬运)《算法导论》习题解答 Chapter 22.1-1(入度和出度)
- Thread类常用方法
- SQL数据插入
- easyui datagrid 后台返回所有数据,前台分页
- HDU 5178 pairs【二分】||【尺取】
- 使用GetAdaptersInfo时,网卡类型的值为71
- Intellij-配置JDK版本和编译版本
- web全栈架构师[笔记] — 02 数据交互
- 2331: [SCOI2011]地板 插头DP
- DSO安装试运行
- stenciljs 学习五 事件
- MySQL 5.1完全卸载