不支持

刷新页面背景图随机的方法

// 随机数函数
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)

 

posted @ 2024-01-18 11:58  骑上我的小摩托  阅读(11)  评论(0编辑  收藏  举报