首页 > 代码库 > 最简单的javascript 竖向菜单

最简单的javascript 竖向菜单

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function k1(vd) {
            var ob = document.getElementById(vd);
            ob.style.display = "none";
            //var ob2 = document.getElementById(‘s‘ + vd);            
        }

        function k0(vd) {
            var ob = document.getElementById(vd);            
            ob.style.display = "block";
            //var ob2 = document.getElementById(‘s‘ + vd);        
        }
    
    </script>

    <style type="text/css">
        .b
        {
            width:100px;
           margin:5px,auto,5px,auto;
           padding:2px,2px;
           background-color:Gray;
           line-height:35px;
           font-family:@Arial Unicode MS;
           font-size:18px;         
        }
        .ps
        {
               display:none;
            }
    
    </style>
</head>
<body>
 
  <div id="sfgc91" class="b" onm ousemove="k0(‘fgc91‘)" onm ouseout="k1(‘fgc91‘)"  onclick="k0(‘fgc91‘)" >
      <a target="FrameRight" href="http://www.mamicode.com/#">菜单1</a>
      <div class="ps" id="fgc91">
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">1-1</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">1-2</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">1-3</a></div>
      </div>
  </div>

   <div id="sfgc92" class="b" onm ousemove="k0(‘fgc92‘)" onm ouseout="k1(‘fgc92‘)"  onclick="k0(‘fgc92‘)">
      <a target="FrameRight" href="http://www.mamicode.com/#">菜单2</a>
      <div class="ps" id="fgc92">
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">2-1</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">2-2</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">2-3</a></div>
      </div>
  </div>

   <div id="sfgc93" class="b" onm ousemove="k0(‘fgc93‘)" onm ouseout="k1(‘fgc93‘)"  onclick="k0(‘fgc93‘)">
      <a target="FrameRight" href="http://www.mamicode.com/#">菜单3</a>
      <div class="ps" id="fgc93">
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">3-1</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">3-2</a></div>
       <div class="b"><a target="FrameRight" href="http://www.mamicode.com/#">3-3</a></div>
      </div>
  </div>

</body>
</html>

最简单的javascript 竖向菜单