zoukankan      html  css  js  c++  java
  • JS——覆盖显示,点击显示三层

    <!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">
    *
    {
        margin:0px;
        padding:0px;
        }
    
    .all
    {
        width:310px;
        height:50px;
        border:#03F 1px solid;
        }
    .left
    {
        width:250px;
        height:50px;
        border:#F00 1px solid;
        }
    .right
    {
        width:50px;
        height:50px;
        border:#0F3 1px solid;
        background-color:#CCC;
        margin-left:255px;
        }    
    .yincang
    {
        height:200px;
        width:200px;
        border:#30F 1px solid;
        background-color:#06F;
        margin-top:30px;
        visibility:hidden;
    
        }                            
    </style>
    </head>
    
    <body>
    <div class="all"> 
       <div class="left">
         <div class="right" onmouseover="xianshi()" onmouseout="yincang()">>><div class="yincang"  id="right"></div>
         </div>
            
       </div>
    
    </div>
    
    </body>
    </html>
    <script type="text/javascript">
    function xianshi()
    {
        var a =document.getElementById("right");
        
        if(a.style.visibility="hidden")
        {
            a.style.visibility="visible";
        }
    
        }
    function yincang()
    {
        var b =document.getElementById("right");
        
        if(b.style.visibility="visible")
        {
            b.style.visibility="hidden";
            
            }
        
        
        }
    
    </script>

    <!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">
    *
    {
        margin:0px;
        padding:0px;
        }
    .diyiceng
    {
        width:500px;
        height:300px; 
        border:#9C6 1px solid; 
        margin:-300px 0px 0px 100px; 
        background-color:yellow;
        visibility:visible;
        }
    .dierceng
    {
        width:500px;
        height:300px; 
        border:#9C6 1px solid;
        background-color:green;
        visibility:hidden;
        margin-left:100px;
        }
    .disanceng
    {
        width:500px;
        height:300px; 
        border:#9C6 1px solid;
        margin-top:-300px;
        margin-left:200px;
        background-color:blue;
        visibility:hidden;
        }                
    </style>
    </head>
    
    <body>
    <div style="600px; height:300px; border:#00F 1px solid">
    <div style="100px; height:300px; border:#F00 1px solid">
    <input type="button" value="第一层"  onclick="xianshiyi()"/><br />
    <input type="button" value="第二层"  onclick="xianshier()"/><br />
    <input type="button" value="第三层"  onclick="xianshisan()"/>
    
    
    </div>
      <!--第一层为黄色 第二层为绿色 第三层为蓝色-->
         <div class="diyiceng" id="diyiceng">
             <div class="dierceng" id="dierceng"></div>
                  <div class="disanceng" id="disanceng"></div>
    
         </div>
    
    
    </div>
    
    </body>
    </html>
    <script type="text/javascript">
    function xianshiyi()
      {
           var a = document.getElementById("dierceng");
           var b = document.getElementById("disanceng");
           var c = document.getElementById("diyiceng");
           
           if(c.style.visibility="hidden")
           {
               c.style.visibility="visible";
               a.style.visibility="hidden";
               b.style.visibility="hidden";
               
               }
          
          
          }      
      function xianshier()
      {
          var a = document.getElementById("dierceng");
          var b = document.getElementById("disanceng");
           if(a.style.visibility="hidden")
           {
               
               a.style.visibility="visible";
               b.style.visibility="hidden";
               }
      }
      function xianshisan()
      {
             var b=document.getElementById("disanceng");
             if(b.style.visibility="hidden")
            {
                 b.style.visibility="visible";
            }
                     
      }
          
      
        
    
    
    </script>
  • 相关阅读:
    Protected和Default的区别
    将数组中负数放在正数前面
    java.io包和杯子测楼
    hadoop基础
    极限编程和JUnit
    接口和抽象类
    C# 中窗口AutoScaleMode属性
    计算机的自启动管理
    labview中的移位寄存器、循环隧道,自动索引隧道的区别
    发现C#winform编程中不常用的控件(一)<FlowLayoutPanel控件><拆分器控件Splitcontainer >
  • 原文地址:https://www.cnblogs.com/Chenshuai7/p/5252994.html
Copyright © 2011-2022 走看看