zoukankan      html  css  js  c++  java
  • jquery 弹出窗

    <!--[if IE 6]>
    <script>
    var isIE6 = true;
    </script>
    <style>
    * html { background-image:url(about:blank); background-attachment:fixed; }
    * html .mask_content { z-index: 9999; position: absolute !important; left: expression(eval(document.documentElement.scrollLeft + document.documentElement.clientWidth/2 - this.offsetWidth/2));top: expression(eval(document.documentElement.scrollTop + document.documentElement.clientHeight/2 - this.offsetHeight/2)); }
    </style>
    <![endif]-->
    <script>
    //通用弹层
    function openLay(options) {
    var content_html_code = typeof options.content_html_code === 'undefined' ? '' : options.content_html_code,
    content_height = typeof options.height === 'undefined' ? 300 : options.height,
    content_width = typeof options.width === 'undefined' ? 400 : options.width;

    var docE = document.documentElement,
    mask = jQuery('<div class="mask"/>').css({position:'absolute','z-index':999,left:'0',top:'0',opacity:'.8',filter:'alpha(opacity=80)','background-color':'#000'}),
    iframe = jQuery('<iframe />').css({position:'absolute','100%',height:'100%','z-index':-1,top:0,left:0,filter:'alpha(opacity=0)'}),
    content = jQuery('<div class="mask_content">' + content_html_code ),
    dom_content = content[0],
    dom_mask = mask[0];

    mask.width(Math.max(document.body.scrollWidth,docE.scrollWidth)).height(Math.max(document.body.scrollHeight,docE.scrollHeight));
    if (typeof isIE6 !== 'boolean') {
    content.css({position:'fixed','z-index':9999,content_width,height:content_height,left:'50%',top:'50%','margin-left':-options.width/2,'margin-top':-options.height/2});

    }

    dom_mask.appendChild(iframe[0]);
    document.body.appendChild(dom_mask);
    document.body.appendChild(dom_content);



    jQuery('#mask_close').click(function(){
    jQuery('.mask_content').fadeOut(500);
    jQuery('.mask').remove();
    jQuery('.mask_content').remove();
    })
    }
    function removMask(){
    jQuery('.mask_content').fadeOut(500);
    jQuery('.mask').remove();
    jQuery('.mask_content').remove();
    }
  • 相关阅读:
    asp.net 取windows的所有进程
    ASP.NET页面的字符编码设置
    c# 检测cpu使用率[测试通过]
    三层业务类(DAL)必用的通用方法之一
    火狐最实用的几款插件介绍[含附件]
    c#生成一组不同的随机数的方法
    ASP.NET 缓存 Cache
    web.config中配置字符串中特殊字符的处理
    asp.net产生客户端Cookie与js操作Cookie大全
    jQuery 计时器(jquery timers)简单应用
  • 原文地址:https://www.cnblogs.com/jinbiao/p/2295591.html
Copyright © 2011-2022 走看看