How can I run .slideUp() and .animate() in sync?
When I write:
- jQuery(".minimizeToTop").toggle(
- function () {
- jQuery("#frontpageflash").slideUp(500),
- jQuery("body").animate({backgroundPosition: "0 -370px "},{duration:500});
-
- },
- function () {
- $("#frontpageflash").slideDown(500),
- jQuery("body").animate({backgroundPosition: "0 0"},{duration:500});
- }
- );
-
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?