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
}
查看全文
相关阅读:
【酷熊科技】工作积累 ----------- Unity3D UITable协程加载问题 (转载 ---- 关于NGUI中UiTable和UIGrid脚本的一点感受)
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 控制角色在真实的环境中寻路
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 动作event实际应用
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- Animator动画状态机
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- Legacy动画系统
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 代码控制音频视频
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 实际应用physic:控制你的角色在真实的环境中行走
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 实际应用physic:控制你的角色在真实的环境中行走
【unity3d study ---- 麦子学院】---------- unity3d常用组件及分析 ---------- 组件的生命周期
设计模式 之 《外观模式》
原文地址:https://www.cnblogs.com/ghd258/p/251506.html
最新文章
BZOJ 1045: [HAOI2008] 糖果传递
BZOJ 1665: [Usaco2006 Open]The Climbing Wall 攀岩
10.30 NFLS-NOIP模拟赛 解题报告
BZOJ 1101: [POI2007]Zap
NOI2014 魔法森林 day1t2 SPFA
NOI2014 起床困难综合症 day1t1
状态压缩动态规划总结
SGU 132. Another Chocolate Maniac
SGU 200. Cracking RSA 高斯消元
Unity打包游戏锁屏之后切换到游戏闪退
热门文章
Unity判断手势在物品的滑动方向(上下左右)
Unity判断手势在物体的滑动是顺时针还是逆时针
Unity3D停止不了协程
Android引用库文件路径报错
判断Unity俩个物体碰撞的方向
判断物体是否在摄像机视野内
Unity调用iOS原生内购
Xcode 9.2 怎么真机调试iOS 11.3的系统手机
把Unity包体构建到steam的后台
【unity3d study ---- 麦子学院】---------- unity3d Ngui 插件项目实战 ---------- Scene跳转
Copyright © 2011-2022 走看看