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
}
查看全文
相关阅读:
CSS中em,rem的区别
Bootstrap自学笔记
lable标签的妙用
Ajax
基础小知识杂烩
用CSS3画出一个立方体---转
CSS3方法总汇
HTML5 DOM扩展
VS2010在C盘下生成的.iTrace文件解决办法 ,c盘偷偷的减少,心很烦啊,找了半天才知道是这个问题
伪静态
原文地址:https://www.cnblogs.com/ghd258/p/251506.html
最新文章
iOS单例模式
NSNumber,NSValue和NSData
iOS基础
NSUserDefaults 可以保存哪些类型
ASIHTTPRequest实现https双向认证请求
iOS发送短信
设置标准控件的文字为中文
UIWebView相关设置
iOS UIApplicationDelegate
iOS 应用程序的生命周期(转CocoaChina)
热门文章
iOS 使用XCode6打开项目以后再用XCode5出现的问题fatal error: malformed or corrupted AST file: 'Unable to load module
iOS ARC环境下dealloc的使用
iOS 使用Xcode和Instruments调试解决iOS内存泄露(链接转)
iOS获取的NSDate date时间与实际相差8个小时
Apple Demo
iOS GCD简单使用
ASIHTTPRequest 记录过去5秒的平均流量字节/秒
Xcode编译错误和警告汇总<转>
z-index详细攻略
伪元素
Copyright © 2011-2022 走看看