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

Asked

Viewed 252 times

4

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

EXAMPLE

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

  • 1

    Good! That’s right, thank you!

  • @Jeffersonalison, glad to help :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.