How to randomly sort list items?

后端 未结 2 1790
不思量自难忘°
不思量自难忘° 2020-12-03 04:15

I currently have this code that randomly sorts list items:

var $ul = $(\'#some-ul-id\');
$(\'li\', $ul).sort(function(){
   return ( Math.round( Math.random(         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 04:37

    I also stuck to such questions I search on google and come across one code. I modify this code for my uses. I also include the shuffle the list after 15 seconds.

    
    

    Hope this solution helps....Have a great working time ..

提交回复
热议问题