日期:2014-05-16 浏览次数:20381 次
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id='vv'>click</div>
<script>
function setStyle(elm,obj){
}
function close(){
var $e = document.getElementById('mask');
$e.style.display='none';
}
function display(){
var $e = document.getElementById('mask');
$e.style.display='block';
}
function createMask(){
var $dw =document.documentElement.clientWidth;
var $dh = document.documentElement.clientHeight;
var $m,$d,$close;
////mask
var $m = document.createElement('div');
//setStyle();
$m.id='mask';
$m.style.height = $dh + 'px';
$m.style.width = $dw + 'px';
$m.style.position = 'absolute';
$m.style.left = '0px';
$m.style.top ='0px';
$m.style.backgroundColor = '#ee9';
document.body.appendChild($m);
///dialog
var $d = document.createElement('div');
$d.id='dialog';
$d.style.height = '100px';
$d.style.width = '200px';
$d.style.position = 'absolute';
$d.style.left = ($dw/2-200/2)+'px';
$d.style.top =($dh/2-100/2)+'px';
$d.style.backgroundColor = '#e11';
$d.innerHTML = "<div id='close'>close</div>";
$m.appendChild($d);
//attach event
var $close = document.getElementById('close');
$close.addEventListener('click',close);
}
createMask();
document.getElementById('vv').onclick = display;
</script>
</body>
</html>
tipsWindown("提示","iframe:http://bbs.csdn.net/","500","350","false","3000","true","msg")