Image Randomization - possible?

Good After-Morn-Evening,

I am attempting to create an image rotator and/or timed image change visualization. The idea is, a user logs into the system and, at the splash screen, is greeted with our menu, and a background image that changes every ‘x’ minutes, or upon button click.

Is this possible?

2 Likes

Yes, if you add the image component from the menu it has a src property in JavaScript. This property expects the URL of an image, or you can use one of the image resources in Dundas BI if you’ve uploaded them.

You can set it with something like:

image1.src = "http://mydomain.com/myimage.jpeg";

You can do this on a button click action, and as well on a timer by adding the timer component. All you’d need to do is then write the code to select what image is displayed. If it’s truly random you can use Math.random() to generate a number and then map segments of that number to different URLs.

If it’s rotating then you can just set a counter on the window and increment it.

2 Likes