zoukankan      html  css  js  c++  java
  • HTML——JAVASCRIPT——关灯效果

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    #b
    {
        100%;
        height:100%;
        position:fixed;
        top:0px;
        left:0px;
        z-index:1;
        background-color:#333;
        opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);
    }
    </style>
    </head>
    
    <body>
    <div id="a" style="z-index:2;position:absolute;height:30px"><input type="button" value="开关" onclick="dianji()"/></div>
    <img id="c" src="新建文件夹 (2)/RadArt1_922.jpg"/>
    <div id="b" style="display:none"></div>
    
    </body>
    <script type="text/javascript">
    function dianji()
    {
        var s=document.getElementById("b").style.display;
        if(s=="block")
        {
            document.getElementById("b").style.display="none";    
        }    
        else
        {
            document.getElementById("b").style.display="block";    
        }
    }
    
    </script>
    </html>
  • 相关阅读:
    inotify事件监控
    NFS网络文件共享服务
    Rsync数据同步服务
    SSH连接原理及ssh-key讲解
    C语言I博客作业04
    C语言l博客作业03
    C语言I博客作业02
    定义一个计算字符串高度的方法
    字典转模型
    UIScrollView和UIPageControl
  • 原文地址:https://www.cnblogs.com/SJP666/p/4704636.html
Copyright © 2011-2022 走看看