$("").hover(function(){
var ary = ["red","green","blue",];
var a= ary[math.floor(math.random()*3)]//
$(this).toggleClass(a);
})
1. Math.ceil()用作向上取整。
2. Math.floor()用作向下取整。
3. Math.round() 我们数学中常用到的四舍五入取整。
$("").hover(function(){
var ary = ["red","green","blue",];
var a= ary[math.floor(math.random()*3)]//
$(this).toggleClass(a);
})
1. Math.ceil()用作向上取整。
2. Math.floor()用作向下取整。
3. Math.round() 我们数学中常用到的四舍五入取整。
转载于:https://www.cnblogs.com/masterccc/p/4623246.html