zoukankan      html  css  js  c++  java
  • 11.10document对象练习

    <!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>
    #cd1{ width:100px; height:175px; background-color:#900; color:#0F0; text-align:center; vertical-align:middle; line-height:35px; }
    #cd2{ width:100px; height:175px; background-color:#900; color:#0F0; text-align:center; vertical-align:middle; line-height:35px; }
    #cd3{ width:100px; height:175px; background-color:#900; color:#0F0; text-align:center; vertical-align:middle; line-height:35px; }
    #a1{ width:100px; height:35px; background-color:#0F0; text-align:center; vertical-align:middle; line-height:34px; border:1px solid #000;}
    #a2{ width:100px; height:35px; background-color:#0F0; text-align:center; vertical-align:middle; line-height:34px; border:1px solid #000;}
    
    
    
    
    
    </style>
    </head>
    
    <body>
    
        <div style=" 100px; height:35px;  color:#0F0; text-align:center; vertical-align:middle; line-height:35px;" onclick="xiala()">首页</div>
        
        <div id="cd1" style=" display:none">
        <div>企业介绍</div>
        <div>产品介绍</div>
        <div>产品中心</div>
        <div>服务中心</div>
        <div>联系我们</div>
        </div>
    
        <div style=" 100px; height:35px;  color:#0F0; text-align:center; vertical-align:middle; line-height:35px;" onclick="xiala2()">企业介绍</div>
        
        <div id="cd2" style=" display:none">
        <div>产品介绍</div>
        <div>产品中心</div>
        <div>服务中心</div>
        <div>联系我们</div>
        </div>
        
        <div style=" 100px; height:35px;  color:#0F0; text-align:center; vertical-align:middle; line-height:35px;" onclick="xiala3()">产品中心</div>
        
        <div id="cd3" style=" display:none">
        <div>产品介绍</div>
        <div>产品中心</div>
        <div>服务中心</div>
        <div>联系我们</div>
        </div>
    
    
    <br />
    <br />
    <br />
    <!--<div style="600px; height:35px; border:1px solid #000; text-align:center; vertical-align:middle; line-height:35px; color:#F00;">-->
        <div id="a1" style="overflow:hidden" onmouseover="chuxian()" onmouseout="yincang()">
        <div id="a2">产品介绍</div>
        <div id="a2">产品中心</div>
        <div id="a2">企业介绍</div>
        <div id="a2">联系我们</div>
        </div>
    </div>
    </body>
    </html>
    <script type="text/jscript">
    function xiala(a)
    {
        var a = document.getElementById("cd1");
        var str="none";
        if(str.indexOf(a.style.display)>=0)
        {
        a.style.display="block";
        }
        else(a.style.display="none")
        
    }
    
    
    function xiala2()
    {
        var a = document.getElementById("cd2");
        var str="none";
        if(str.indexOf(a.style.display)>=0)
        {
        a.style.display="block";
        }
        else a.style.display="none";
    }
    
    function xiala3()
    {
        var a = document.getElementById("cd3");
        var str="none";
        if(str.indexOf(a.style.display)>=0)
        {
        a.style.display="block";
        }
        else a.style.display="none";
    }
    
    
    function chuxian()
    {
        var a = document.getElementById("a1");
        a.removeAttribute("style");
    }
    
    function yincang()
    {
        var a = document.getElementById("a1");
        a.setAttribute("style","overflow:hidden");
    }
    </script>
  • 相关阅读:
    java集合-方法
    Java线程池
    java疯狂讲义第18章类的加载和反射
    java疯狂讲义第16章多线程
    JAVA集合-HashMap的实现原理
    类加载-java new一个对象的过程发生了什么/Java对象创建过程
    JVM-java垃圾回收
    JVM-java内存区域
    JVM-java堆-新生代和老年代
    448. 找到所有数组中消失的数字
  • 原文地址:https://www.cnblogs.com/chaochao00o/p/6287005.html
Copyright © 2011-2022 走看看