六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 151|回复: 0

遮罩层与模式窗口

[复制链接]

升级  23.33%

76

主题

76

主题

76

主题

举人

Rank: 3Rank: 3

积分
270
 楼主| 发表于 2013-2-7 20:37:59 | 显示全部楼层 |阅读模式
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=gbk" /><title>jQuery UI Example Page</title><link type="text/css" href="css/ui-lightness/jquery-ui-1.8.13.custom.css" rel="stylesheet" /><script type="text/javascript" src="js/jquery-1.5.1.min.js"></script><script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script><script type="text/javascript">$(function(){  $('#dialog').dialog({                        autoOpen: false,                        width: 600,                        buttons: {                            "Ok": function() {                                $(this).dialog("close");                            },                             "Cancel": function() {                                $(this).dialog("close");                             }                           }  ,beforeClose:function(){ $("#full").hide();}                 });   });function openDialog(){var full  = $("#full"); full.css("width",getClientW_H(1)+"px").css("height",getClientW_H(2)+"px").show();$("#dialog").dialog("open");}window.onresize=function(){  $("#full").css("width",getClientW_H(1)+"px").css("height",getClientW_H(2)+"px");}function getClientW_H(type){if(1==type){ //widthreturn Math.max(Math.max(document.body.scrollWidth,document.body.clientWidth),Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth));}else{      //heightreturn Math.max(Math.max(document.body.scrollHeight,document.body.clientHeight),Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight))}}</script><style type="text/css">*{font-size:13px}#full{position: absolute;background:#9DA7C3;left: 0;top: 0;display: none; z-index:2;filter:alpha(opacity=50);opacity :0.5}</style> </head><body> <div><input type="button" id="btn" value="打开模式窗口" /><br><div id="full"></div><div id="dialog" title="系统提示">这是dialog</div> </body></html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表