zoukankan
html css js c++ java
弹出窗口大全(js)
//
==========================================================================
//
//
代码描述:打开一个新的有状态栏、工具栏、菜单栏、定位栏,
//
可以改变大小,且位置居中的新窗口
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
//
返回参数:无
//
//
//
==========================================================================
function
g_OpenSizeWindow(pageURL, innerWidth, innerHeight)
{
var
ScreenWidth
=
screen.availWidth
var
ScreenHeight
=
screen.availHeight
var
StartX
=
(ScreenWidth
-
innerWidth)
/
2
var
StartY
=
(ScreenHeight
-
innerHeight)
/
2
window.open(pageURL, '', 'left
=
'
+
StartX
+
', top
=
'
+
StartY
+
', Width
=
'
+
innerWidth
+
', height
=
'
+
innerHeight
+
', resizable
=
yes, scrollbars
=
yes, status
=
yes, toolbar
=
yes, menubar
=
yes, location
=
no')
}
//
==========================================================================
//
//
代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//
不能改变大小,且位置居中的新窗口
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
//
返回参数:无
//
//
//
==========================================================================
function
g_OpenWindow(pageURL, innerWidth, innerHeight)
{
var
ScreenWidth
=
screen.availWidth
var
ScreenHeight
=
screen.availHeight
var
StartX
=
(ScreenWidth
-
innerWidth)
/
2
var
StartY
=
(ScreenHeight
-
innerHeight)
/
2
window.open(pageURL, '', 'left
=
'
+
StartX
+
', top
=
'
+
StartY
+
', Width
=
'
+
innerWidth
+
', height
=
'
+
innerHeight
+
', resizable
=
no, scrollbars
=
yes, status
=
no, toolbar
=
no, menubar
=
no, location
=
no')
}
//
==========================================================================
//
//
代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//
不能改变大小,且位置居中的新窗口
//
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
//
返回参数:返回的数值
//
//
//
==========================================================================
function
g_OpenReturnWindow(pageURL, innerWidth, innerHeight)
{
var
ScreenWidth
=
screen.availWidth
var
ScreenHeight
=
screen.availHeight
var
StartX
=
(ScreenWidth
-
innerWidth)
/
2
var
StartY
=
(ScreenHeight
-
innerHeight)
/
2
window.open(pageURL, '', 'left
=
'
+
StartX
+
', top
=
'
+
StartY
+
', Width
=
'
+
innerWidth
+
', height
=
'
+
innerHeight
+
', resizable
=
no, scrollbars
=
yes, status
=
no, toolbar
=
no, menubar
=
no, location
=
no')
return
false
}
function
g_OpenReturnWindowNoScrollbars(pageURL, innerWidth, innerHeight)
{
var
ScreenWidth
=
screen.availWidth
var
ScreenHeight
=
screen.availHeight
var
StartX
=
(ScreenWidth
-
innerWidth)
/
2
var
StartY
=
(ScreenHeight
-
innerHeight)
/
2
window.open(pageURL, '', 'left
=
'
+
StartX
+
', top
=
'
+
StartY
+
', Width
=
'
+
innerWidth
+
', height
=
'
+
innerHeight
+
', resizable
=
no, scrollbars
=
no, status
=
no, toolbar
=
no, menubar
=
no, location
=
no')
//
return false
}
//
==========================================================================
//
//
代码描述:打开一个新的没有状态栏、工具栏、菜单栏、定位栏,
//
不能改变大小,且位置居中的新窗口
//
//
传入参数:pageURL - 传递链接
//
//
返回参数:无
//
//
//
==========================================================================
function
g_OpenReturnWindowPrint(pageURL)
{
var
ScreenWidth
=
screen.availWidth
var
ScreenHeight
=
screen.availHeight
//
var StartX = (ScreenWidth - innerWidth) / 2
//
var StartY = (ScreenHeight - innerHeight) / 2
var
Win
=
window.open(pageURL, '','Width
=
'
+
ScreenWidth
+
', height
=
'
+
ScreenHeight
+
', resizable
=
no, scrollbars
=
no, status
=
no, toolbar
=
no, menubar
=
no, location
=
no, left
=
0
, top
=
0
')
Win.moveTo(
99999
,
99999
)
return
false
}
//
==========================================================================================
//
//
代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
返回参数:无
//
//
//
==========================================================================================
function
g_OpenModalWindow(pageURL, innerWidth, innerHeight)
{
window.showModalDialog(pageURL,
null
, 'dialogWidth:'
+
innerWidth
+
'px;dialogHeight:'
+
innerHeight
+
'px;help:no;unadorned:no;resizable:no;status:no')
}
//
==========================================================================================
//
//
代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏 ,并且返回值
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
返回参数:模式窗体返回的returnValue
//
//
//
==========================================================================================
function
g_OpenreturnWindow(pageURL, innerWidth, innerHeight)
{
var
returnv;
returnv
=
window.showModalDialog(pageURL,
null
, 'dialogWidth:'
+
innerWidth
+
'px;dialogHeight:'
+
innerHeight
+
'px;help:no;unadorned:no;resizable:no;status:no')
return
returnv;
}
//
==========================================================================================
//
//
代码描述:打开模式窗口函数,打开一个模式窗口不包含菜单、状态条、工具条、定位栏
//
//
传入参数:pageURL - 传递链接
//
innerWidth - 传递需要打开新窗口的宽度
//
innerHeight - 传递需要打开新窗口的高度
//
返回参数:无
//
//
//
==========================================================================================
function
g_OpenReturnModalWindow(pageURL, innerWidth, innerHeight)
{
window.showModalDialog(pageURL,
null
, 'dialogWidth:'
+
innerWidth
+
'px;dialogHeight:'
+
innerHeight
+
'px;help:no;unadorned:no;resizable:no;status:no');
return
false
;
}
//
==========================================================================================
//
//
代码描述:关闭窗口
//
//
传入参数:无
//
//
返回参数:无
//
//
//
==========================================================================================
function
g_CloseWindow()
{
window.close()
return
false
}
查看全文
相关阅读:
爬取淘宝商品信息
eclipse 搭建Robotium环境--apk 环境搭建
android studio2.0 搭建Robotium环境--有被测源代码的情况下
mysql 特殊语句
电脑浏览器访问文件夹
mindmanager 15 停止工作
yum被lock Existing lock /var/run/yum.pid: another copy is running as pid 1580. Another app is currently holding the yum lock; waiting for it to exi
jenkins安装及部署
ant+jmeter
charles抓包及篡改
原文地址:https://www.cnblogs.com/ghd258/p/251506.html
最新文章
10.27
日报9.27
日报9.25
日报9.24
日报9.23
日报9.22
每周总结-1
日报9.21
日报9.20
日报9.19
热门文章
日报9.18
QHDYZ模拟赛20191012
素数判定与筛法
模拟赛20191004——三道洛谷题
Codeforces 游记
离散化 笔记与思路整理
js中事件流的理解
js中兼容问题的解决
字符串 String
数组 Array
Copyright © 2011-2022 走看看