How can I run .slideUp() and .animate() in sync?

How can I run .slideUp() and .animate() in sync?

When I write:
  1. jQuery(".minimizeToTop").toggle(
  2.           function () {
  3.            jQuery("#frontpageflash").slideUp(500),
  4.            jQuery("body").animate({backgroundPosition: "0 -370px "},{duration:500});
  5.      
  6.           },
  7.           function () {
  8.             $("#frontpageflash").slideDown(500),
  9.             jQuery("body").animate({backgroundPosition: "0 0"},{duration:500});
  10.           }
  11.         );
The element #frontpageflash slides up and after that body background image position moves but how can I execute these two synchronously so both would move same time?
    • Topic Participants

    • spam