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高级应用参考手册
通过ClassLoader说明容器热部署实现机制
自定义类加载器
zz Ubuntu常用命令大全
设计模式之Decorator(油漆工)
zz JNI学习(一)、JNI简介和HelloWorld示例
类加载器的基本概念
使用 StAX 解析 XML,第 1 部分: Streaming API for XML (StAX) 简介
ubuntu apache mod_expires模块
清空ubuntu 日志
原文地址:https://www.cnblogs.com/cxd4321/p/667776.html
最新文章
lua 字符串数学表达式运算
iphone开发证书制作
[置顶] ffmpeg 0.8.11 VC编译的SDK已经发布
ffmpeg AT&T汇编转intel汇编 之(emms_c)
ffmpeg AT&T汇编转intel汇编 之(emms_c)
iphone开发证书制作
委托的前世今生
【深入浅出WF】——持久化
【深入浅出WPF】——WPF
请购流程
热门文章
深入浅出ASP.NET
开发Visual Studio风格的用户界面--MagicLibrary使用指南 [转]
Worldwind (类似Google Earth的.net Virtual Globe程序)控件版 [转]
Expanel 控件[原创]
CSS属性列表[转]
c#条件编译
具有自动完成功能的TextBox控件
WinForm中页面传值的方式
outlookbar control
财富
Copyright © 2011-2022 走看看