Help a ajax noob with ajax page transitions


I just started reading about ajax and managing to load pages using this:

$(function() {

  var $pageContent = $('#main');
  var loadContent = function(url) {
    $pageContent.fadeOut(function() {
      $pageContent.load(url, function() {
  $('#main-menu a').on('click', function(event) {

But what I want to do in the end is transition the old page out and the new page in using CSS transitions by adding/removing classes, with a “loading” state in between. How would you do this?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.