弹出全屏显示的网页模式对话框
2012-12-10 08:58
666 查看
这个实例主要应用screen对像的width、height属性和window对象的showModeaDialog()方法实现。
首先创建一个对话框页面hh12.html,在index.html主页中创建”打开对话框”超级链接。
<a href=”#” onClick=”opendialog()”>打开对知框</a>
编写自定义的JavaScript函数opendialog(),用于打开全屏显示的网页对话框,程序代码如下:
function opendialog(){
var width=screen.width;
var height=screen.height;
window.showModalDialog("hh12.html","","dialogWidth="+width+"px;dialogHeight="+height+";status=no;scrollbars=no")
}
然后是创建hh12.html页面的内容:
<script type="text/javascript">
function mycheck(myform){
if(myform.Manager.value==""){
alert("请输入管理员!");myform.Manager.focus();return;
}
if(myform.PWD.value==""){
alert("请输入密码!");myform.PWD.focus();return;
}
myform.submit();
}
</script>
</head>
<body style="width:100%;">
<form method="post" action="" name="myform">
<table width="100%" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td width="20" height="65"> </td>
<td width="82"> </td>
<td width="200"> </td>
<td width="20" > </td>
</tr>
<tr>
<td height="34"> </td>
<td align="center" class="word"> 管理员:</td>
<td>
<input name="Manager" type="text" class="txt_grey" id="Manager3" onkeydown="if(event.keyCode==13)myform.PPWD.focus();" maxlength="20">
</td>
<td> </td>
</tr>
<tr>
<td height="34"> </td>
<td align="center" class="word"> 密 码:</td>
<td>
<input name="PWD" type="password" class="txt_grey" id="PWD" onkeydown="if(event.keycode==13)mycheck(myform)" maxlength="20">
</td>
<td> </td>
</tr>
</table>
</form>
此时的效果就是你打开对话框后,必需关闭对话框才能浏览网页。这个方法可以实现弹出的网站后台管理员登录窗口,还可以实现当用户执行非法操作后,弹出一个大大的警告框。
文章来源:http://www.cssyoo.com/a/jstexiao/20121209/js_26.html
首先创建一个对话框页面hh12.html,在index.html主页中创建”打开对话框”超级链接。
<a href=”#” onClick=”opendialog()”>打开对知框</a>
编写自定义的JavaScript函数opendialog(),用于打开全屏显示的网页对话框,程序代码如下:
function opendialog(){
var width=screen.width;
var height=screen.height;
window.showModalDialog("hh12.html","","dialogWidth="+width+"px;dialogHeight="+height+";status=no;scrollbars=no")
}
然后是创建hh12.html页面的内容:
<script type="text/javascript">
function mycheck(myform){
if(myform.Manager.value==""){
alert("请输入管理员!");myform.Manager.focus();return;
}
if(myform.PWD.value==""){
alert("请输入密码!");myform.PWD.focus();return;
}
myform.submit();
}
</script>
</head>
<body style="width:100%;">
<form method="post" action="" name="myform">
<table width="100%" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td width="20" height="65"> </td>
<td width="82"> </td>
<td width="200"> </td>
<td width="20" > </td>
</tr>
<tr>
<td height="34"> </td>
<td align="center" class="word"> 管理员:</td>
<td>
<input name="Manager" type="text" class="txt_grey" id="Manager3" onkeydown="if(event.keyCode==13)myform.PPWD.focus();" maxlength="20">
</td>
<td> </td>
</tr>
<tr>
<td height="34"> </td>
<td align="center" class="word"> 密 码:</td>
<td>
<input name="PWD" type="password" class="txt_grey" id="PWD" onkeydown="if(event.keycode==13)mycheck(myform)" maxlength="20">
</td>
<td> </td>
</tr>
</table>
</form>
此时的效果就是你打开对话框后,必需关闭对话框才能浏览网页。这个方法可以实现弹出的网站后台管理员登录窗口,还可以实现当用户执行非法操作后,弹出一个大大的警告框。
文章来源:http://www.cssyoo.com/a/jstexiao/20121209/js_26.html
相关文章推荐
- JavaScript特效实例011-弹出全屏显示的网页模式对话框
- 网页显示QQ在线点击弹出聊天对话框代码
- 关于无法显示该网页,弹出对话框显示"Internet Explorer无法打开Internet站点xxx,已终止操作"问题的解决方法
- 如何在网页上弹出一个对话框显示一些内容javascript
- window.location.reload()方法刷新页面弹出要再次显示该网页对话框
- DIV全屏-弹出模式对话框
- 弹出网页模式对话框window.showModalDialog
- 页面刷新刷新页面时,IE弹出“要再次显示该网页....”对话框,解决办法
- window.location.reload()方法刷新页面弹出要再次显示该网页对话框
- JavaScript-1.最简单的程序之网页弹出对话框,显示为Warning---ShinePans
- 弹出全屏显示的网页
- 刷新页面时,IE弹出“要再次显示该网页....”对话框,解决办法
- JavaScript特效实例010-弹出网页模式对话框
- JavaScript-1.最简单的程序之网页弹出对话框,显示为Warning---ShinePans
- jquery 网页全屏显示插件
- Delphi中点击网页弹出的Alert对话框的确定按钮
- Windows核心编程学习一:使用DialogBoxParam显示模式对话框
- VC对话框全屏显示及相应控件位置改变
- 自己整理得一个JavaScript写的一个DIV 弹出网页对话框
- JavaScript写的一个DIV 弹出网页对话框