How to animate elements being loaded using jQuery load method

How to animate elements being loaded using jQuery load method

I am using ajax to load a new form once the old form has been submitted. the code looks like below:

  1. $(document).on('click', '.next', function() {
  2.         if ($(this).hasClass('disabled')) {
  3.             return false;
  4.         }
  5.         var toLoad = $(this).attr('href') + '#content';

  6.         $('#main-container #content').transition({ 'x' : '-100%' , duration:700 } , function() {
  7.            loadContent();     
  8.         });
  9.         // $('#main-container').animate({ 'opacity': 1 }, loadContent);
  10.         window.location.hash = $(this).attr('href').substr(0, $(this).attr('href').length - 5);

  11.         function loadContent() {
  12.             $('#main-container').load(toLoad, '', showNewContent())
  13.         }

  14.         function showNewContent() {
  15.             $('#main-container').show('normal');
  16.         }
  17.         return false;
  18.     });

  19.     /* enable next button */

  20.     $(document).on('change', '[type="radio"]', function() {
  21.         var checked_no = $('[type="radio"]:checked').length;
  22.         if (checked_no > 0) {
  23.             $('.btn-next').removeClass('disabled');
  24.         }
  25.     });


Now i would like to have a transition animation , when the 1st form is submitted it slides to the left and from the right the new slide comes in , just like in a normal slider caousel.

When the 1st form is submitted i managed to get a animation for it to slide to the left and it exactly what i want , i used a plugin transit.js and just used the below lines of code to acheive the transition:

  1. $('#main-container #content').transition({ 'x' : '-100%' , duration:700 } , function() {
  2.            loadContent();     
  3.         });
but now how to i transition the content being loaded ? as of now it just loads using the load function and thats quite lame , i understand that the difficulty level to do this next animation is slightly higher and i am unable to think of a way to get this content to load with an animation(An animation that slides in from the right).

So how exactly do i animate content being loaded using the load jQuery method and transit.js ??