Search code examples
jqueryeventschaining

jQuery: Chaining Events - code correction


Can any one tell me how can i replace the slideup function with fadeout('slow') for the below code

 div.slideUp(function() {        
        div.load("GetResults.aspx?mode=bymanu&mid="+manuId,
                         { symbol: $("#txtSymbol" ).val() },
                           function() {
                           $(this).slideDown();                               
                       });

Instead of slideUp,I want to use the FadeOut function with a speed .How can i chain up the events ?

I want to replace the SlideDown also with FadeIn('slow')

Thanks in advance...


Solution

  • The jQuery docs are actually a really good place to check for syntax like this.

    div.fadeOut('slow', function() {        
        div.load(
            "GetResults.aspx?mode=bymanu&mid="+manuId,
            { symbol: $("#txtSymbol" ).val() },
            function() {
                $(this).fadeIn('slow');                               
            }
        );
    });