Use JAVASCRIPT+DIV+CSS to implement the drop-down menu. Displays the corresponding div:function Show (menu) when the mouse moves to the menu option. Hides all div:function hide () when the mouse is moved out.

Source: Internet
Author: User

<!--program Ch02_11_menu.html-->
<title> drop-down menu instances </title>
<script language= "JavaScript" >
Displays the corresponding div when the mouse moves to the menu option
Function Show (menu)
{document.getElementById (menu). style.visibility= "Visible";}
Hide All div When mouse is moved out
function Hide () {
document.getElementById (menu1). style.visibility= "hidden";
document.getElementById (MENU2). style.visibility= "hidden";
document.getElementById (MENU3). style.visibility= "hidden";
}
</script>
<body>
<table>
<tr bgcolor= "#9999FF" align= "Center" >
&LT;TD width= "onmousemove=" Show (' menu1 ') "onmouseout=" Hide () "> Series Courses </td>
&LT;TD width= "onmousemove=" Show (' menu2 ') "onmouseout=" Hide () "> Teaching Courseware </td>
&LT;TD width= "onmousemove=" Show (' Menu3 ') "onmouseout=" Hide () "> Course Outline </td>
</tr>
</table>
<div id= "menu1" onmousemove= "Show (' menu1 ')" onmouseout= "Hide ()"
style= "background: #9999FF;p osition:absolute;left:12;top:38;width:120;
Visibility:hidden ">
<span>c++ Programming </span><br>
<span>java Programming </span><br>
<span>c# Programming </span><br>
</div>
<div id= "Menu2" onmousemove= "Show (' menu2 ')" onmouseout= "Hide ()"
style= "background: #9999FF;p osition:absolute;left:137;top:38;width:120;
Visibility:hidden ">
<span>c++ Courseware </span><br>
<span>java Courseware </span><br>
<span>c# Courseware </span><br>
</div>
<div id= "Menu3" onmousemove= "Show (' Menu3 ')" onmouseout= "Hide ()"
style= "background: #9999FF;p osition:absolute;left:260;top:38;width:120;
Visibility:hidden ">
<span>c++ Outline </span><br>
<span>java Outline </span><br>
<span>c# Outline </span><br>
</div>
</body>

Use JAVASCRIPT+DIV+CSS to implement the drop-down menu. Displays the corresponding div:function Show (menu) when the mouse moves to the menu option. Hides all div:function hide () when the mouse is moved out.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.