I am adding few results on click of a button. I am using slideDown method to show these new results, but no idea why these new results first slideUp and then perform a slideDown animation. And when I clear added results, it is removed instantly with no animation at all.
Please have a look on this demo: http://jsbin.com/imulem
$('#sb').click ( function(){
var html = '';
html += "<div class='result'>" + 'fake results.. ' + '</div>';
html += "<div class='result'>" + 'fake results.. ' + '</div>';
html += "<div class='result'>" + 'fake results.. ' + '</div>';
$(html).hide().prependTo('#searchresults').slideDown('slow');
});
$('#clearb').click ( function(){
$('#searchresults>div').slideUp('slow').remove();
});
I gave to
.resulta class namedh0which hasheight: 0px;property. This way they have no height when you click#sb. You should removedivs after animation ends.For chrome problem, change the transition from
alltobackground-color.You can find working case here.
CSS
Javascript