JS只弹出一个居中弹出窗口
2014-05-21 23:29
316 查看
var newWindow;//定义一个窗口,有利于窗口间的通讯
function makeNewWindow(url) {
if (!newWindow || newWindow.closed) {
var width = 400;
var height = 300;
var left = parseInt((screen.availWidth/2) - (width/2));//屏幕居中
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
newWindow = window.open(url, "subWind", windowFeatures);
} else {
// window is already open, so bring it to the front
newWindow.focus();
}
}
function makeNewWindow(url) {
if (!newWindow || newWindow.closed) {
var width = 400;
var height = 300;
var left = parseInt((screen.availWidth/2) - (width/2));//屏幕居中
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
newWindow = window.open(url, "subWind", windowFeatures);
} else {
// window is already open, so bring it to the front
newWindow.focus();
}
}
相关文章推荐
- JS只弹出一个居中弹出窗口
- JS只弹出一个居中弹出窗口
- JS只弹出一个居中弹出窗口
- 一个不错的弹出窗口,修改了JS文件可多弹
- 一个不错的弹出窗口的js效果(值的收藏)
- .NET中用弹出窗口添加或修改一个页面,当添加或修改相关内容后按下提交按钮自动刷新页面的JS代码
- js弹出的对话窗口永远保持居中显示
- 推荐一个JS弹出窗口LightFace
- 一个不错的弹出窗口的js效果(值的收藏)
- 弹出窗口根据内容调整大小并居中的JS实现(适用IE、活动窗口和模式窗口)
- JS JavaScript 模态窗口为什么提交给自己总是弹出一个新窗口??
- js多级树形弹出一个小窗口层(非常好用)实例代码
- js让弹出新窗口居中显示的脚本
- 在使用JS调用Window.close()方法关闭一个窗口是,如何禁止弹出对话窗口?
- ASP.net 让窗口WEB打开后,弹出一个选择窗口供应选择,注意Page_Load顺序,JS产生的找不到对象的问题
- js弹出的窗口居中显示
- js弹出窗口居中
- 一个不错的弹出窗口的js效果(值的收藏)
- js弹出一个新窗口进行选择并且返回这个页面的值-showModalDialog
- js多级树形弹出一个小窗口层,非常好用