zoukankan      html  css  js  c++  java
  • 用jquery实现遮罩层

    <div style=" display:none" id="yinying"></div>
    
    <script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
    
    <script type="text/javascript">
    
    function showUnitInfo()
    {
    
    var screenWidth = $(window).width();//当前窗口宽度
    var screenHeight = $(window).height();//当前窗口高度
    
    $("#yinying").css({"display":"","position": "fixed","background": "#000","z-index": "1001","-moz-opacity": "0.5","opacity":".50","filter": "alpha(opacity=50)","width":screenWidth,"height":screenHeight});
    
    }
    
    </script>

    jquery写的,使用前需要引用类库。

    先写一个不显示的div,当触发事件时,为这个div添加样式,高度=当前窗口高度,宽度=当前窗口宽度。

     
  • 相关阅读:
    many2many
    oneselfone
    one2one
    10-many2one
    08-one2many
    05-curd
    动态SQl
    文件系统缓存dirty_ratio与dirty_background_ratio两个参数区别
    expect用法举例
    通过命令修改mysql的提示符
  • 原文地址:https://www.cnblogs.com/sosoft/p/3451108.html
Copyright © 2011-2022 走看看