Wix random image

 avatar
unknown
plain_text
2 years ago
404 B
10
Indexable
// Velo API Reference: https://www.wix.com/velo/reference/api-overview/introduction

const photoAlbum = ["https://i.imgur.com/jvm4XjB.png", "https://i.imgur.com/cg0U99Z.jpg", "https://i.imgur.com/nQXJu9J.jpg"]

$w.onReady(function () {
	const randomPhotoIndex = Math.floor(Math.random()*photoAlbum.length);
	console.log("Hello world!");
	$w("#section2").background.src = photoAlbum[randomPhotoIndex];
});
Editor is loading...