Skip to main content
Question

How do I set an array of images and randomise results?

  • November 1, 2022
  • 0 replies
  • 541 views

itswaihong

Hello Figma community!

I’m Wai Hong, just started out to learn Javascript. 😊 I’m trying to build a photo randomiser every time user click on a button. How do I set an array of image src urls and using onclick => to get a random result? I tried using Math.random but seems like it will not work in Figma.

Would love to know any way I could work around this? Thanks!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings