slideUp() function doesn't work at onunload event - What is a problem?

slideUp() function doesn't work at onunload event - What is a problem?

Hi,

I have some problem with onunload where I want slideUp my menu when I go out form site.

I have the slideDown function fire at body onload and this function work properly.
but  the slideUp() at onunload not.

Could anyone have any idea?

My code:
  1. $(window).unload(function() {
  2.    $('#menuContent1').slideUp();
  3.   alert('Handler for .unload() called.');
  4. });
and even the alert work. Only the jQuery slideUp not working.