views:

365

answers:

1

Hello everyone,

i try to get a solution for following problem.

synchron fadeout and fadeTo with different elements.

the page behavior should be like this - page load - content hidden - menu shown - content fadeIn and menu fadeTo opacity 0.0

my snippset of code

$(document).ready(function(){
     $(".content_main").hide();
     $(".content_main").fadeIn(8000);
     $(".header > ul").ajaxSend(function(){this.fadeTo("8000", 0.0)});
});

but this isn't synchron, any hint ??

+1  A: 

Try this:

$(document).ready(function(){
        $(".content_main").hide();
        $(".content_main").fadeIn(8000, function () {
            $(".header > ul").ajaxSend(function(){this.fadeTo("8000", 0.0)});
        });
});

You basically specify a callback for fadeIn, so when it finishes, it calls that function. I'm not sure this is exactly what you want, but you get the idea.

cloudhead
thx, but i try the callback function befor, there the problem is that the callback is call after the fadeIn