我目前有这个代码随机排序列表项:
var $ul = $('#some-ul-id'); $('li', $ul).sort(function(){ return ( Math.round( Math.random() ) - 0.5 ) }).appendTo($ul);
但是,有没有更好的解决方案呢?
javascript sorting random jquery html-lists
html-lists ×1
javascript ×1
jquery ×1
random ×1
sorting ×1