zoukankan      html  css  js  c++  java
  • 背景变暗弹出对话框的html/js代码

    Check it:

    <html>
        
    <head>
            
    <title>EXAMPLE</title>
            
    <style>
            .overlay
    {
                display
    : none;
                position
    : absolute;
                top
    : 0%;
                left
    : 0%; 
                width
    : 100%; 
                height
    : 100%; 
                background-color
    : gray; 
                z-index
    :1001; 
                -moz-opacity
    : 0.8; 
                opacity
    :.80; 
                filter
    : alpha(opacity=50); 
            
    } 
            .content 
    {
                display
    : none;
                position
    : absolute;
                top
    : 25%; 
                left
    : 25%; 
                width
    : 50%; 
                height
    : 50%; 
                padding
    : 16px; 
                border
    : 16px solid blue; 
                background-color
    : white; 
                z-index
    :1002; 
                overflow
    : auto; 
            
    } 
            
    </style>
        
    </head>
        
    <body>
            
    <p>灰化背景
            
    <href="javascript:void(0)" onclick="document.getElementById('light').style.display='block'; document.getElementById('fade').style.display='block'">点击</a>打开窗口
            
    </p>
            
            
    <div id="light" class="content">
            弹出窗口的内容写在这里。点击
    <href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">X</a>这里关闭窗口
            
    </div>
            
    <div id="fade" class="overlay"></div>
        
    </body>
    </html>
  • 相关阅读:
    (转)批量导出存储过程
    (转)ylbtech-cnblogs(博客园)-数据库设计-6.0-Msg(短消息)
    (转)怎样玩转千万级别的数据
    (转)处理上百万条的数据库如何提高处理查询速度
    (转)SQLSERVER表分区的介绍(二)
    (转)SQLSERVER表分区的介绍(一)
    (转)在SQL中取出字符串中数字部分或在SQL中取出字符部分
    (转)SQL按照日、周、月、年统计数据
    构建操作mysql的类
    解决Celery 在Windows中搭建和使用的版本
  • 原文地址:https://www.cnblogs.com/super119/p/2180458.html
Copyright © 2011-2022 走看看