我有这样的代码:
$.ajax({
url : url,
data : {ids : JSON.stringify(jsonids), hotel_id: hotel_id},
success : function(response)
{
$('#be-images ul').prepend(response).fadeIn('slow');
},
dataType: 'html'
});但淡入不起作用...我想要的内容是预先和褪色in...how我会这样做吗?
提前感谢!
发布于 2009-12-15 16:55:13
假设response是超文本标记语言,那么试试这个:
$(response).hide().prependTo("#be-images ul").fadeIn("slow");当你这样做的时候:
$('#be-images ul').prepend(response).fadeIn('slow');您实际淡入的内容是初始选择器(前面的列表)的结果,它已经可见。
发布于 2009-12-15 21:31:12
+1到cletus,但我只想强调一下你可以用另一种方式来做。
$('#be-images ul').prepend(
$(response).hide().fadeIn('slow')
);发布于 2017-11-02 23:27:22
试试这个: HTML
<button>Add</button>
<div id="data"></div>Jquery:
$('button').click(function() {
$('#data').prepend('<div class="item">Test</div>'"');
$("#data .item:first-child").hide();
$("#data .item:first-child").fadeIn();
});现场演示:
https://stackoverflow.com/questions/1906066
复制相似问题