标签:
function pos(){ var items = $(‘.starone‘); items.each(function () { var rand = getRandom(); $(this).addClass("pos-" + rand); }); } var arry=[1,2,3,4,5,6,7]; function getRandom() { var i=Math.floor(Math.random()*arry.length); var rand=arry[i]; arry.splice(i,1); return rand; } pos();
标签:
原文地址:http://www.cnblogs.com/ecmasea/p/5946607.html