码迷,mamicode.com
首页 > 移动开发 > 详细

鼠标移动现实二级菜单

时间:2016-11-11 14:12:43      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:weight   nbsp   play   line   javascrip   div   style   rip   splay   

*{ margin:opx auto; padding:0px;}

 #leibie{ width:500px; height:36px; border:1px solid #03F;}

 .yuyan{ float:left; width:100px; height:36px; text-align:center; line-height:36px; vertical-align:middle; font-weight:bold;}

  .yuyan:hover{ cursor:pointer; background-color:#96C; color:white;}

 #yuyan2{ width:100px; height:100px; position:relative; top:36px; left:-100px; background-color:#0F0; display:none}

 #yuyan3{ width:100px; height:100px; position:relative; top:36px; left:-100px; background-color:#FF0; display:none}

 #yuyan4{ width:100px; height:100px; position:relative; top:36px; left:-100px; background-color:#0FF; display:none}

 #yuyan5{ width:100px; height:100px; position:relative; top:36px; left:-100px; background-color:#F00; display:none}

       </style>

<body>

<div id="leibie">

  <div class="yuyan" onmouseover="xianshi(‘yuyan2‘)" onmouseout="yincang(‘yuyan2‘)">.net</div>

    <div style="float:left; width:0px">

        <div id="yuyan2"></div>

        </div>

  <div class="yuyan" onmouseover="xianshi(‘yuyan3‘)"onmouseout="yincang(‘yuyan3‘)">java</div>

    <div style="float:left; width:0px">

        <div id="yuyan3"></div>

        </div>

  <div class="yuyan" onmouseover="xianshi(‘yuyan4‘)" onmouseout="yincang(‘yuyan4‘)">php</div>

    <div style="float:left; width:0px">

        <div id="yuyan4"></div>

        </div>

  <div class="yuyan" onmouseover="xianshi(‘yuyan5‘)" onmouseout="yincang(‘yuyan5‘)">IOS</div>

    <div style="float:left; width:0px">

        <div id="yuyan5"></div>

        </div>

</div>

</body>

<script type="application/javascript">

function xianshi(d)

{

 var aa = document.getElementById(d);

  aa.style.display = "block";

}  

function yincang(d)

  {   

var aa = document.getElementById(d)

   aa.style.display="none";

   }  

</script>

鼠标移动现实二级菜单

标签:weight   nbsp   play   line   javascrip   div   style   rip   splay   

原文地址:http://www.cnblogs.com/hao0/p/6053794.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!