刷新页面背景图随机的方法
// 随机数函数
function getRandom(N,M)ireturn Math.floor(Math.random()*(M-N+1))+ N // 随机数 const random=getRandom(1,10) document.body.style.backgroundImage =`url(./images/desktop ${random}.jpg)
// 随机数函数
function getRandom(N,M)ireturn Math.floor(Math.random()*(M-N+1))+ N // 随机数 const random=getRandom(1,10) document.body.style.backgroundImage =`url(./images/desktop ${random}.jpg)