0

我正在使用 jQuery 和 Bootstrap 制作聊天系统

我想同时显示三个消息。

我想显示msg1,然后msg2通常让msg3淡入:

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

但它使每条消息都淡出。

我只想让最后一条消息淡入。

我怎样才能做到?

4

1 回答 1

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

$(msg3).hide().fadeIn(500); // if msg3 is already a jQuery object, you can omit the $() wrapping function
于 2013-08-02T12:45:07.637 回答