Animate function jQuery

Posted by Antonio Pitasi on Stack Overflow See other posts from Stack Overflow or by Antonio Pitasi
Published on 2012-06-23T15:05:46Z Indexed on 2012/06/23 15:16 UTC
Read the original article Hit count: 241

Filed under:
|

I'm new here and I have a problem the jQuery's function "animate"

function myFunction(newpage) {

$('#loader').animate({opacity: 0.0}, 400, 'linear', function(){

    // callback of fadeOut()
    $(this).load(newpage + ".php #toload", function(){

        // callback of load()
        $('#loader').animate({opacity: 100.0}, 400, 'linear', function(){
            //callback of fadeIn()
            // (not relevant for my problem, I think)
            $.getScript("js/test.js");
        });

      });

   });

}

My problem is: the first "animate" works like a charm but the second load the new content correctly, without the animation (a simple fadeIn).

Anyone can help me? Thanks in advice!

P.S. Sorry for my english

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about animate