zoukankan      html  css  js  c++  java
  • JavaScript+css+ div HTML遮罩層效果

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test</title>
        <script  src="jquery.1.11.0.min.js"></script>
        <script type="text/javascript">
            $(function () {
                settime_show();
                $('#btn').click(function () {
                    
                    
                });
            });
            
            function settime_show() {
                setTimeout(show, 2000);
    
            }
    
            function show() {
                $('.bg').show();
                $('.show').fadeIn('slow')
                //$('.show').show('slow');
                setTimeout(hide, 4000);
                //$('.show').slideToggle('slow')
                //$('.show').fadeToggle('slow');
    
            }
            function hide() {
                //$('.bg').hide('slow');
                //$('.show').hide('slow');
                $('.show').fadeOut('slow');
                $('.bg').fadeOut('slow');
            }
         </script>
        <style type="text/css">
            .bg {
                display: none;
                position: absolute;
                top: 0%;
                left: 0%;
                width: 100%;
                height: 100%;
                background-color: black;
                z-index: 1001;
                -moz-opacity: 0.7;
                opacity: .70;
                filter: alpha(opacity=70);
            }
    
            .show {
                display: none;
                position: absolute;
                top: 25%;
                left: 22%;
                width: 53%;
                height: 49%;
                padding: 8px;
                border: 8px solid #E8E9F7;
                background-color: white;
                z-index: 1002;
                text-align:center;
                /*overflow: auto;*/
            }
    
                
        </style>
    </head>
    <body>
           <button id="btn">show</button>
           <div class="show">
               <img src="/356.jpg"  width="300" height="300"/>
           </div>
           <div class ="bg"></div>
    </body>
    </html>
     
  • 相关阅读:
    部署yearning1.3
    git常用指令
    U盘centos7系统安装http://www.augsky.com/599.html
    C语言与SQL SERVER数据库(转)
    C连接MySQL数据库开发之Windows环境配置及测试(转)
    vs2012中添加lib,.h文件方法(原)
    如何用Visual Studio 2013 (vs2013)编写C语言程序 (转)
    Java值传递以及引用的传递、数组的传递!!
    ssh整合需要那些jar
    类加载器
  • 原文地址:https://www.cnblogs.com/stuart/p/5131430.html
Copyright © 2011-2022 走看看