JQuery
var x = 5;//最大值
var y = 1;//最小值
var rand = parseInt(Math.random() * (x - y + 1) + y);
Mvc控制器
Random num = new Random();
int rad = num.Next(1, 5);
JQuery
var x = 5;//最大值
var y = 1;//最小值
var rand = parseInt(Math.random() * (x - y + 1) + y);
Mvc控制器
Random num = new Random();
int rad = num.Next(1, 5);