I’m trying to find a way to load different content (basically <img> and <a>) within divs, on every page load.
I know it is possible to do, since many sites use “dynamic” or “rotating” banners which either load different content on a defined interval or on page load.
Many thanks for any help 🙂
I would do this by making an array of objects containing the URLs of the image and the link, then using
Math.random()to select a random one.You might well want something more complex than this, but this should give you a starting point.