专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016
微信咨询
|
联系我们
扫二维码关注公众号
网站首页
网站建设
短视频
网站推广
网站模板
客户案例
资讯动态
关于我们
网站首页
网站建设
短视频
网站推广
网站模板
客户案例
资讯动态
关于我们
易建快网-网页特效-窗口特效-点击弹出固定居中的遮罩层
当前位置:
网站建设
>
技术支持
易建快网-网页特效-窗口特效-点击弹出固定居中的遮罩层
资料来源:网络整理
时间:
2023/2/14 0:03:34
共计:
3608
浏览
<!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>
<title>易建快网-网页特效-窗口特效-点击弹出固定居中的遮罩层</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<style type="text/css">
.hidden{display:none;}
#smallLay{width:498px; height:100px;padding:4px 10px 10px;background-color:#FFFFFF;border:1px solid #05549d;color:#333333;line-height:24px;text-align:left;-webkit-box-shadow:5px 2px 6px #000;-moz-box-shadow:3px 3px 6px #555;}
</style>
<script type="text/javascript">
//判断浏览器ie6创建的div样式和非ie6创建的div样式
//创建div
function showid(idname){
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var newbox=document.getElementById(idname);
newbox.style.zIndex="9999";
newbox.style.display="block"
newbox.style.position = !isIE6 ? "fixed" : "absolute";
newbox.style.top =newbox.style.left = "50%";
newbox.style.marginTop = - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px";
var layer=document.createElement("div");
layer.id="layer";
layer.style.width=layer.style.height="100%";
layer.style.position= !isIE6 ? "fixed" : "absolute";
layer.style.top=layer.style.left=0;
layer.style.backgroundColor="#000";
layer.style.zIndex="9998";
layer.style.opacity="0.6";
document.body.appendChild(layer);
var sel=document.getElementsByTagName("select");
for(var i=0;i<sel.length;i++){
sel[i].style.visibility="hidden";
}
function layer_iestyle(){
layer.style.width=Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)
+ "px";
layer.style.height= Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) +
"px";
}
function newbox_iestyle(){
newbox.style.marginTop = document.documentElement.scrollTop - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
}
if(isIE){layer.style.filter ="alpha(opacity=60)";}
if(isIE6){
layer_iestyle()
newbox_iestyle();
window.attachEvent("onscroll",function(){
newbox_iestyle();
})
window.attachEvent("onresize",layer_iestyle)
}
layer.onclick=function(){newbox.style.display="none";layer.style.display="none";for(var i=0;i<sel.length;i++){
sel[i].style.visibility="visible";
}}
}
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<input type="button" id="showbtn" name="showbtn" value="点击显示" onclick="showid('smallLay');">
<div id="smallLay" style="display:none;"></div>
</body>
</html>
版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
相关主题:
门户网站建设费用预算
郴州网站建设项目教程
承德品牌网站建设选择
营口网站关键词建设
南通企业建设网站方案
北京为什么要做网站建设
如何提高网站建设的性能
唐山网站建设模板哪里有
自适应网站建设哪家最好
昆明做网站建设的步骤
·上一条:
CSS定义HR水平线的几种样式
|
·下一条:
CSS expression属性用法详解
同类资讯
CSS定义HR水平线的几种样式
如何提高ASP.NET页面载入速度的方法
ASP.NET页面优化,性能提升8倍的方法
asp.net 提高网站速度及如何利用缓存
CSS 单行溢出文本显示省略号...的方法(兼容IE FF)
asp.net(c#)中文验证码程序
JQuery学习笔记:typeof的使用
prototype.js中class类详解
JQuery和Prototype区别小结
jQuery 如何写插件
使用jQuery.fn自定义jQuery翻页插件
jQuery插件的编写相关技术 设计总结和最佳实践
jQuery下扩展插件和拓展函数的写法
Jquery控制My97DatePicker控件的日期格式
EasyUI 链接按钮
EasyUI 菜单按钮
EasyUI Window和Layout
EasyUI 创建对话框
asp.net(c#)网页跳转七种方法
C# 用timespan函数 计算日期时间差
资讯动态
公司新闻
互联网资讯
电商资讯
优化推广
技术支持
关于我们
公司简介
企业文化
服务项目
公司新闻
服务项目
网站建设
网站推广
品牌策划
移动应用
服务支持
在线咨询
服务流程
产品报价
售后服务
联系我们
代理加盟
付款方式
在线留言
联系方式
联系方式
电话:400-683-0016
邮箱:sales@gzit.cn
QQ:250211130
微信:18520775521
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有
粤ICP备16019765号
广州京杭网络科技有限公司 版权所有
返回顶部
400-683-0016
在线咨询
微信二维码