代码:
setInterval(function () { var material=Math.random()*(2000-1119+1)+1119; material=Math.round(material); $(".material").html(material); var people=Math.random()*(2000-1119+1)+1119; people=Math.round(people); $(".people").html(people); var design=Math.random()*(2000-1119+1)+1119; design=Math.round(design); $(".design").html(design); var quality=Math.random()*(2000-1119+1)+1119; quality=Math.round(quality); $(".quality").html(quality); var maxfont=material+people+design+quality; $(".maxfont").html(maxfont);},500);
Math.random()*(2000-1119+1)+1119; 得到1119-2000之间的一个随机值