码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript+CSS+DIV实现下拉菜单示例

时间:2017-10-25 15:14:41      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:body   blog   doc   function   logs   下拉   element   span   asc   

<!DOCTYPE html>
<html>
  <head>
    <title>下拉菜单示例</title>
	<script language="javaScript">
	    function show(menu)
	        {document.getElementById(menu).style.visibility="visible";}
	    function hide(){
	        document.getElementById("menu1").style.visibility="hidden";
	        document.getElementById("menu2").style.visibility="hidden";
	        document.getElementById("menu3").style.visibility="hidden";
	    }
	</script>
  </head>
  
  <body>
   <table>
       <tr bgcolor="#9999FF"align="center">
       <td width="120"onMouseMove="show(‘menu1‘)"onMouseOut="hide()">系列课程</td>
       <td width="120"onMouseMove="show(‘menu2‘)"onMouseOut="hide()">教学课程</td>
       <td width="120"onMouseMove="show(‘menu3‘)"onMouseOut="hide()">课程大纲</td>
       </tr>
   </table>
   <div id="menu1"onMouseMove="show(‘menu1‘)"onMouseOut="hide()"
       style="background:#9999FF;position:absolute;left:12;top:38;width:120;visibility:hidden">
       <span>c++程序设计</span><br>
       <span>java程序设计</span><br>
       <span>c#程序设计</span><br>
   </div>
   <div id="menu2"onMouseMove="show(‘menu2‘)"onMouseOut="hide()"
       style="background:#9999FF;position:absolute;left:137;top:38;width:120;visibility:hidden">
       <span>c++课件</span><br>
       <span>java课件</span><br>
       <span>c#课件</span><br>
   </div>
   <div id="menu3"onMouseMove="show(‘menu3‘)"onMouseOut="hide()"
       style="background:#9999FF;position:absolute;left:260;top:38;width:120;visibility:hidden">
       <span>c++教学大纲</span><br>
       <span>java教学大纲</span><br>
       <span>c#教学大纲</span><br>
   </div>
  </body>
</html>

  技术分享

JavaScript+CSS+DIV实现下拉菜单示例

标签:body   blog   doc   function   logs   下拉   element   span   asc   

原文地址:http://www.cnblogs.com/www-x/p/7728691.html

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