Adding Menu height to submenu height

Adding Menu height to submenu height

Hello,  here I am attempting at making the topmenu extend its own height as the submenus reveal. Can you please explain to me why it is not working?

$('#topmenu a').hover(function() {
        $('#topmenu').stop(true, true).animate({
       'height': $("#topmenu").css('height') + $(".sub-menu").css('height')
   }, 'fast');
    });
$('#topmenu').mouseout(function() {
        $('#topmenu').animate({
       'height': $("#topmenu").css('height')
   }, 'fast');
    });