DHTML to simulate the implementation of the Drop-down menu
Source: Internet
Author: User
I see on many websites above all has the Pull-down menu, causes the website to be more lifelike! Like Microsoft's homepage, later I thought if the single div and JavaScript can also achieve, through several experiments also always succeed, now put their own ideas to tell you, I hope you can add a Drop-down menu page to make the network ye more vivid.
In the previous DOS to write applications are facing the interface to write, like the menu of these things to their own from beginning to end, to the win era, through event-driven we are very easy to write, not to mention the menu integrated into the system, Writing menus under IE is also based on the response to menu pull and hide by capturing mouse events,
We'll first use a table to display the menu bar,
<table>
<tr>
<TD height= "9" width= "Align=center bgcolor=" #33FFFF ">menu1</td>
<TD height= "9" width= "Align=center bgcolor=" #33FFFF ">menu1</td>
<tr>
<table>
<div id= "Menuwenxue" style= "Position:absolute; width:90px; height:115px; Z-index:1; left:245px; top:75px; Visibility:hidden ">
<table width= "100%" height= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<TD height= "Ten" class= "Menufont" > </td>
</tr>
<tr>
<TD height= "Align=center class=" Menufont "bgcolor= #ff00ff ><a href=" Javascript:alert (' menu1_item1 ') " >menu1_item1</a></td>
</tr>
<tr>
<TD height= "Align=center bgcolor= #ff00ff ><a href=" Javascript:alert (' menu1_item2 ') ">menu1_item2< /a></td>
</tr>
<tr>
<TD height= "Align=center bgcolor= #ff00ff ><a href=" Javascript:alert (' menu1_item3 ') ">menu1_item3< /a></td>
</tr>
</table>
</div>
-->
</script>
I cut it off from the debug code. To get good results need to change the seat relationship, of course, also pay attention to the mouse when the mobile menu will appear abnormal phenomenon, of course, these can be added some code to solve, mainly the mouse out of the menu, the menu will not disappear, You can hide the menu from other objects by intercepting the onmouseover event!
"This article copyright belongs to the author and the Osso net jointly owns, if needs to reprint, please indicate the author and the origin"
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