Random function

How Can I rotate image in random degree or random seconds ? Also how is the random pick works … for example when the user presses the button, one of the image will appear randomly but I dont want the image to appear twice, can you help me on that please!


You can use Math.random() in javascript to generate a random number, and then databind this to the parameter you want to randomize, such as the number of degrees or seconds on a rotation.

For the logic of making an image appear just once, you can use a list in JavaScript from which you pick random items, and then remove items from the list when they are picked to make sure they are not picked again.

Hope that helps :slight_smile:

Thank You