CSS遮罩层,全兼容

<script type="text/javascript">
$(function(){
	$(‘#divLocker‘).css({
        "position": "absolute",
        "margin-left": 0,
        "margin-top": 0,
        "background": "rgba(0, 0, 0, 0.8)",
        "height": function(){ return $(document).height();},
        "width": function(){ return $(document).width();},
	"overflow": "hidden",
        "z-index": "999"
    });
});
</script>

<body>
<div id="divLocker" style="display: none;">我是内容</div>

内容部分需要屏幕居中显示
<div id="payInterface" style="margin: auto; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; width:<?=$w?>px; height: <?=round($w*0.9*357/420, 2)?>px;"><img src="http://www.cnblogs.com/images/pay.png"  width="90%" /></div>

  

时间: 2024-08-01 11:23:58

CSS遮罩层,全兼容的相关文章

DIV CSS遮罩层

<!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>DIV CSS遮罩层</title&

css遮罩层

父元素:position:fixed; 让子元素居中对齐:position:absolute;top:0;bottom:0;left:0;right:0;margin:auto; <style> .loading{width:100%;height:100%;position:fixed;top:0;left:0;z-index:100;background:#fff;} .loading .pic {width:50px;height:50px;background:url(images/l

div+css 遮罩层

CSS样式部分: ---------------------------------- <style type="text/css">#loading-mask{        position:absolute;        left:0;        top:0;        width:100%;        height:100%;        z-index:20000;        background-color:gray;    }    #lo

JS+CSS简单实现DIV遮罩层显示隐藏【转藏】

<!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>DIV CSS遮罩层</title

JS与CSS实现遮罩层及弹出层效果

其实就是事先在网页里加入两个div框,控制显隐实现的功能. 以下为实现代码(非本人原创,网上找的,我对CSS不感冒): <!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/xht

jQuery遮罩层插件

在网页上经常遇到需要等待很久的操作,比如导出报表等.为了预防用户点击其他操作或者多次点击同个功能,需要用遮罩层把页面或者操作区盖住,防止用户进行下一步操作,同时可以提高界面友好度,让用户知道操作正在执行. $.fn.extend({ /** * 给元素添加遮罩层 * @param message {String} [可选]遮罩层显示内容 */ mask: function (message) { var $target = this, fixed = false, targetStatic =

JS遮罩层——如何使被遮罩后的链接可以点击

在遮罩层的使用过程中,发现了一个问题,如果有一个有<a></a>标签链接的HTML页面,如果使用JS遮罩层将此HTML页面遮罩,则此链接无法点击:如果要使此链接可以点击,则需要在<a></a>标签中添加style属性“position:relative;”,例如: 1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head> 3 <title>DIV CS

清除移动端网站点击a标签时闪现的边框或遮罩层(CSS)

  在移动端网站,当你点击加了a标签的文字或图片时,该元素的周围会闪现一个蓝色的边框,在微信上的网站就是如此:而有的浏览器会闪现一个半透明遮罩层,比如移动端的Chrome浏览器,其实这些特效无非就是为了告诉用户已点击了该元素,提升用户体验,但有的时候你会觉得这些特效看起来很别扭,就想着清除它,其实这很简单,只要加上一句CSS就行了. 清除所有a标签在点击时出现的特效: a{ -webkit-tap-highlight-color:rgba(255,0,0,0);}

jQuery+CSS 简单代码实现遮罩层( 兼容主流浏览器 )

/* ** jQuery版本:jQuery-1.8.3.min.js ** 浏览器:Chrome( v31.0.1650.63 m ),IE11,Firefox( v32.0.1 ),IETester下IE8-IE10** Author:博客园小dee */ 比起使用注册页和登陆页,网站在当前页使用遮罩层注册和登陆的用户体验要好不少.这里使用jQuery和CSS实现一个简单的遮罩效果. 在页面点击"注册",出现一层有不透明度的黑色遮罩:遮罩层的上方是注册框:此时无法点击页面上除注册框外