在这段代码中,我使用fadein效果来追加数据。问题是,wrapper_middle中的所有内容都会隐藏,然后又会淡入。如何才能将此效果仅添加到附加的数据?
$this.find('.wrapper_middle').hide().append(data).fadeIn(500);发布于 2013-12-07 22:55:22
$this.find('.wrapper_middle').append($(data).hide().fadeIn(500));或
$(data).hide().fadeIn(500).appendTo( $('.wrapper_middle', $this) );发布于 2013-12-07 22:56:01
使用appendTo()确定要追加的元素的目标
$(data).hide().appendTo($this.find('.wrapper_middle')).fadeIn(500);发布于 2013-12-07 22:56:04
.append()将返回您附加了element的new element的对象。但.appendTo()正好相反,它将返回appended element的对象。.appendTo()将满足您的需要。
尝尝这个,
$(data).appendTo($this.find('.wrapper_middle')).hide().fadeIn(500);https://stackoverflow.com/questions/20442752
复制相似问题