My JQuery slide animation lags when sliding the #res div.
Any suggestions?
JQuery:
$(document).ready(function(){ $('select.first').change(function(){ $(this).prop('disabled', true); var codata = $(this).val(); var page = 1; $.ajax({ type:'POST', url:'page.php', dataType:'json', data:{country:codata, page:page}, success: function(data) { var result=''; $.each(data, function(i,e) { result += "<div id='outer'>"+e.sDo+'</div>'; }); $('#res').html(result); } }).done(function(){$('#res').slideDown();}); }); }); CSS:
#res { background-color:gainsboro; border:1px solid gray; width:100%; display:none; padding-top:10px; } #outer { width:100px; text-align:center; border:1px dotted black; margin:0 0 10px 10px; display:inline-block; height:40px; }
outer) which is invalid, though not relevant to your current problem.