求一段jquery弹出页面代码(遮罩效果)? 我需要一个点击按钮后,弹出遮罩页面小的代码,那位大侠帮帮忙啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>测试</title><style>#test{ width:500px; height:350px; border:1px solid red; background:#999; opacity:0.6; display:none; margin-left:200px; margin-top:200px; position:absolute; z-index:1000;}</style><script src="jquery-1.3.2.js"></script><script>$(function(){ $("#btn").click(function(){ $("#test").show(); });});</script></head><body><input type="button" id="btn" value="显示" /><div id="test"></div></body></html>大小自己可以设置,位置也可以根据margin-top或者margin-left 来修改 function outboxshow(i){ var width = document.documentElement.clientWidth; var newobj = document.createElement('div'); if( window.screen.availHeight < document.body.scrollHeight ){ height = document.body.scrollHeight; }else{ height = window.screen.availHeight; } newobj.setAttribute('id','bigdiv'); newobj.style.position= "absolute" ; newobj.style.width= width + "px"; newobj.style.height= height + "px"; newobj.style.top="0px"; newobj.style.left="0px"; newobj.style.background = "#000"; newobj.style.filter = "Alpha(opacity=60);"; newobj.style.opacity = "0.6"; newobj.style.zIndex = "100001"; newobj.innerHTML = '<iframe style="position:absolute;top:-5px;left:0;width:100%;height:100%;background:#000;filter:alpha(opacity=0);"></iframe>'; document.body.appendChild(newobj); selfH = $('#out_box'+i).height() ; selfW = $('#out_box'+i).width() ; height = document.documentElement.clientHeight -selfH ; width = document.body.scrollWidth - selfW ; $('#out_box'+i).css('top',$(window).scrollTop()+height/2); $('#out_box'+i).css('left',width/2); $('#out_box'+i).css('z-index',100002); $('#out_box'+i).css('display','block'); $(window).scroll(function(){ $('#out_box'+i).css('top',$(window).scrollTop()+height/2); });} 百度jquery.tools.js overlay含有jquery 的遮罩 http://topic.csdn.net/u/20100223/17/edb27cb3-24ff-461d-9cff-eb8b8816b6bf.html?26770给你个传送门 里面有源码 jquery.loadmask.js$('#target').mask('含有jquery 的遮罩');$('#target').unmask(); 关于一个原型链例子的问题,菜鸟求解 取出text的value 如果用JS 判断图片是否被载入 求JavaScript高级程序设计 中文版 有没有能生成组织结构图的代码(不是菜单) 怎样动态改变父页面中指定iframe的高度? 怎样用javascript删除用户选定的表格行? 如何在层中直接显示某网站主页??? 为何有的机子不能进行打印预览?(急死了!TMD经理的机子不能运行!) 初涉javascript,还请前辈指教?看书找不到答案?谢谢 js和jquery混写的奇怪问题 如何获取表单里的value值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试</title>
<style>
#test{
width:500px;
height:350px;
border:1px solid red;
background:#999;
opacity:0.6;
display:none;
margin-left:200px;
margin-top:200px;
position:absolute;
z-index:1000;
}
</style>
<script src="jquery-1.3.2.js"></script>
<script>
$(function(){
$("#btn").click(function(){
$("#test").show();
});
});
</script>
</head><body>
<input type="button" id="btn" value="显示" />
<div id="test"></div>
</body>
</html>
大小自己可以设置,位置也可以根据margin-top或者margin-left 来修改
{
var width = document.documentElement.clientWidth;
var newobj = document.createElement('div');
if( window.screen.availHeight < document.body.scrollHeight ){
height = document.body.scrollHeight;
}else{
height = window.screen.availHeight;
}
newobj.setAttribute('id','bigdiv');
newobj.style.position= "absolute" ;
newobj.style.width= width + "px";
newobj.style.height= height + "px";
newobj.style.top="0px";
newobj.style.left="0px";
newobj.style.background = "#000";
newobj.style.filter = "Alpha(opacity=60);";
newobj.style.opacity = "0.6";
newobj.style.zIndex = "100001";
newobj.innerHTML = '<iframe style="position:absolute;top:-5px;left:0;width:100%;height:100%;background:#000;filter:alpha(opacity=0);"></iframe>';
document.body.appendChild(newobj);
selfH = $('#out_box'+i).height() ;
selfW = $('#out_box'+i).width() ;
height = document.documentElement.clientHeight -selfH ;
width = document.body.scrollWidth - selfW ;
$('#out_box'+i).css('top',$(window).scrollTop()+height/2);
$('#out_box'+i).css('left',width/2);
$('#out_box'+i).css('z-index',100002);
$('#out_box'+i).css('display','block');
$(window).scroll(function(){
$('#out_box'+i).css('top',$(window).scrollTop()+height/2);
});
}
overlay
含有jquery 的遮罩
$('#target').unmask();