刷新后更新图片
作者:互联网
window.onload = choosePic;
function choosePic() {
var myPix = new Array('./tupian/二维码02.png', './tupian/二维码.jpg', './tupian/qrcode.bmp');
var randomNum = Math.floor((Math.random() * myPix.length));
//下面的id与img标签上对应,可以设置多个
document.getElementById('bianhua').src = myPix[randomNum];
document.getElementById('bianhua1').src = myPix[randomNum];
}
标签:tupian,randomNum,var,更新,刷新,myPix,document,Math,图片 来源: https://www.cnblogs.com/zyb99812/p/12767868.html