/* window. onl oad=function () {
Var daohang=document. GetElementById (" daohang ");
The lis=daohang. GetElementsByTagName (" li ");
for(i=0; i
The lis [I]. Style. onm ouseover=function () {
Uls=lis [I] getElementsByTagName (" ul ");
Uls [0]. Style. Height="130 px"
}
Lis [I] style. The onm ouseout=function () {
Uls=lis [I] getElementsByTagName (" ul ");
Uls [0]. Style. Height="0"
}
}
} */
The function nav (liID, ulID) {
Var oLi=document. GetElementById (liID);
Var oUl=document. GetElementById (ulID);
OLi. onm ouseover=function () {
OUl. Style. Height="130 px";
};
OLi. onm ouseout=function () {
OUl. Style. Height='0';
}
}
Window. The onl oad=function () {
Nav (' li0 ', 'ul0');
Nav (' li1 ', 'ul1);
Nav (' li2 ', 'ul2');
Nav (' li3 ', 'ul3');
}
</script>
<style>
The nav {width: 430 px; height: 40px; Background: # D73033; text-align: center; line-height: 40px; list-style: none; padding: 0; }
A {color: # FFF; text-decoration: none; }
Li {width: 100 px; height: 40px; Background: # D73033; }
. Nav> Li {float: left; Margin - right: 10 px; }
. Nav> Li: last - child {margin - right: 0; }
Li> Ul {position: absolute; height: 0; overflow: hidden; The transition: height 0.5 s; list-style: none; Padding: 0; Margin: 0 px}
</style>
<body>