<script type="text/javascript">
window.onload = function(){
var Lis = document.getElementsByTagName('li');
var timer
//console.log(Lis)
for (var i = 0; i < Lis.length ; i++) {
Lis[i].onmouseover =function(){
var u = this.getElementsByTagName('ul')[0];
if(u != undefined){
//clearTimeout(timer);
u.style.display = "block";change(u.id,1);}
}
Lis[i].onmouseleave =function(){
var u = this.getElementsByTagName('ul')[0];
if(u != undefined){
//clearTimeout(timer);
change(u.id,-1);
}
}
}
};
function change(id,count){
var ulList = document.getElementById(id)
var H = ulList.offsetHeight;
H += count;
if (count > 0) {
if (H<=111) {
ulList.style.height = H+"px";
timer=setTimeout("change('"+id+"',1)",1)
}else{
return;
};
}else{
if (H > 0) {
clearTimeout(timer);
ulList.style.height = H+"px";
timer = setTimeout("change('"+id+"',-1)",1)
}else{
ulList.style.display = "none"
return;
}
};
}
// function AddH(id){
// var ulList = document.getElementById(id)
// var H = ulList.offsetHeight;
// H += 1
// };
// function SubH(id){
// var ulList = document.getElementById(id)
// var H = ulList.offsetHeight;
// H = H-1
// };
</script>