mirror-crappy-reverie/assets/js/kirby-img.js

10 lines
288 B
JavaScript
Raw Permalink Normal View History

2023-10-28 12:03:33 +00:00
function randomImageBroker(ElemName, imgArray) {
const imgEl = document.getElementById(ElemName);
randomImage(imgEl, imgArray)
}
function randomImage(imgELM, srcArray) {
const randomIndex = Math.floor(Math.random()*srcArray.length);
imgELM.src = srcArray[randomIndex];
}