Fade In ok, Fade out not ok. What the reason?

Fade In ok, Fade out not ok. What the reason?


I actually have a JSP page with this basic HTML elements;

  1. <div style="display:none;" id="loadingBar"><img src="images/loading-big.gif" alt="loading"/> </div>
  2.                 <div style="display:none;" id="result"></div>

and then the JQUERY with these source code;

  1. var content;
  2. var dataString = "ha";

  3. $( function() {

  4.     $.validator.addMethod("username", function(value, element) {
  5.         return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
  6.     }, "UserID: only letters, numbers, or underscore.");

  7.     $('#userAccountForm').validate();

  8.     $('input').focus( function() {
  9.         content = $(this).val();
  10.         if(content=='- none -') {
  11.             $(this).val("");
  12.         }
  13.     } );
  14.     
  15.     $('input').blur( function() {
  16.         content = $(this).val();
  17.         if(content=='') {
  18.             $(this).val("- none -");
  19.         }
  20.     } );

  21.     $('.tableModifierButton input:submit').click( function(){

  22.         var emptyThing = "- none -";

  23.         // ensure all fields are not empty
  24.         // we use word - none - as empty field
  25.         var usName = $('#username').val();
  26.         var email = $('#email').val();
  27.         var contc = $('#mobilephone').val();
  28.         //    var photo = $('#avatar').val();
  29.         var usId = $('#userid').val();
  30.         var pass = $('#password').val();
  31.         var editClient = $('input:radio[name=editClient]:checked').val();
  32.         var addClient = $('input:radio[name=addClient]:checked').val();
  33.         var delClient = $('input:radio[name=deleteClient]:checked').val();
  34.         var adminPriv = $('input:radio[name=adminPriv]:checked').val();

  35.         if(adminPriv==undefined){
  36.             adminPriv = "staff";
  37.         } else {
  38.             adminPriv = "administrator";
  39.         }

  40.         if(usName==emptyThing){
  41.             usName = "none";
  42.         }
  43.         if(contc==emptyThing){
  44.             contc = "0";
  45.         }
  46.         if(pass==emptyThing){
  47.             pass = "default";
  48.         }

  49.         dataString = 'username='+usName+"&contact="+contc+"&email="+email+"&userid="+usId+"&password="+pass+"&editclient="+editClient+"&addclient="+addClient+"&deleteclient="+delClient+"&adminprivillege="+adminPriv;
  50.         
  51.         $('#userAccountForm').fadeOut(1000, function(){
  52.             $('#loadingBar').fadeIn(300);
  53.         } );

  54.         var options = {
  55.             type: "POST",
  56.             url: "user-form-function",
  57.             data: dataString,
  58.             success: function(msg){

  59.                 $('#result').html(msg).fadeIn("slow");
  60.                   $('#loadingBar').fadeOut("slow");
  61.             }
  62.         };

  63.         $.ajax( options );

  64.         return false;
  65.         
  66.     } );

  67. } );



Strangely is... the  loadingBar FadeIn effect come nicely.
But when at line 73; when It reached success call, it never fading out.

  1.                   $('#loadingBar').fadeOut("slow");

is this line not working when it came into success portion or.... there's something wrong with my source code? I confused ....