jQuery AJAX fadeIn内容[重复]

This question already has answers here:
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2012-10-03 06:04:45Z" class="relativetime">7 years ago</span>.</div>
        </div>
    </aside>

Possible Duplicate:
Making my ajax updated div fade in

I want the content from AJAX call to fadeIn on my page, but when I use this code $('#sub_container').html(content).fadeIn(); it doesn't work, even if I set the animation speed to super slow (slow(5000))

$('.create').click(function(){
    loadingimg();
    document.title = 'Create Message';
    $.ajax({
        url: 'create.php',
        dataType: 'html',
        success: function(content){
            $('#sub_container').html(content);
            // $('#sub_container').html(content).fadeIn(); <- Fails
        }
    });
});
</div>

The .fadeIn() function essentially makes the element visible, so will appear to do nothing if the element is already visible. You can ensure that's not the case by hiding the element:

$('#sub_container').hide().html(content).fadeIn();

You need to make sure it's hidden to begin with, for example:

$('.create').click(function(){
$('#sub_container').fadeOut();    // fade out the current content
loadingimg();
document.title = 'Create Message';
$.ajax({
    url: 'create.php',
    dataType: 'html',
    success: function(content){
        $('#sub_container').html(content).stop().fadeIn();    // fade in the new content
    }
});
});

But that can get you jumping content as the element disappears so you have to account for that if necessary.