How to use fadeIn () with an append ()?

4

How to add the fadeIn () effect, along with an append ().

EXAMPLE

    
asked by anonymous 19.02.2014 / 23:36

1 answer

5

Test like this:

var count = 5; 
$('#addCount').click(function () {
    var p = $('<p>' + count + '</p>'); // criar o elemento 
    p.hide();                          // escondê-lo
    $('#new_elem').append(p);          // "appendê-lo" ou "appendar" o <p>
    p.fadeIn();                        // fazer fade in com ele já na página
    count++;
});

Example

    
19.02.2014 / 23:39