whitebear
whitebear

Reputation: 12445

How to use prepend hide fadeIn

I am making chat system with jQuery and Bootstrap

I want to show three message at the same time.

I want to show msg1 and msg2 normally then let msg3 fade in:

$('#chat-history').prepend(msg1)
$('#chat-history').prepend(msg2) 
$('#chat-history').prepend(msg3).hide().fadeIn(500); 

But it makes every message fade in.

I want to let only the last message fade in.

How can I make it?

Upvotes: 0

Views: 69

Answers (1)

André Dion
André Dion

Reputation: 21718

$('#chat-history').prepend(msg1, msg2, msg3);

$(msg3).hide().fadeIn(500); // if msg3 is already a jQuery object, you can omit the $() wrapping function

Upvotes: 3

Related Questions