1. 程式人生 > >jq隨機打亂元素順序

jq隨機打亂元素順序

 $("ul>li").each(function(){
			if(parseInt(Math.random()*2)==0){
				$(this).prependTo($(this).parent());
			}	
	});