$(function () {
$('.nav1 > .nav-li').hover(function () {
var sec_count = $(this).find('.nav-ul li').length;
var a_height = $(this).find('.nav-ul li').eq(0).height();
var sec_height = sec_count * a_height;
$(this).find('.nav-ul').stop().animate({
height: sec_height
}, 300);
}, function () {
$(this).find('.nav-ul').stop().animate({
height: 0
}, 300);
});
});