Hide flash of unresized div without CSS

Hide flash of unresized div without CSS

Hi. I have a div that on hover opens. My script on load finds the height of the div, then resizes it. My issue is that because of this resizing the full size of the div is breiefly displayed before jQuery resizes it.

Is there anyway to hide this flash without CSS?

  1. var basket_height = $('#basket').height();
        $('#basket').css({ height : '30px' });
        if (Modernizr.touch){
            $('#basket').toggle(function() {
                $(this).animate({ height: basket_height + 'px' }, {duration: 'slow', easing: 'easeOutBounce'});    
              }, function() {
                $(this).animate({ height: '30px' });
              });
        } else {
            $('#basket').mouseenter(function() {
                $(this).animate({ height: basket_height + 'px' }, {duration: 'slow', easing: 'easeOutBounce'});    
            }).mouseleave(function() {
                $(this).animate({ height: '30px' });
            });
        }














Thank you