Jump to content

Random image replace from array?


Helmet

Recommended Posts

This is probably not that complicated, but I'm fairly new to JS and can't quite figure out how to do this. I need to have 36 images on a page, their src and link href values pulled from a db with php (I'm fine with that part) and I'd like these images to randomly replace by others. So I'm thinking I need to build a javascript array of say, 72 images, display 36 of them, and then have some kind of random timing where a random image is replaced by the next one in the array. Does this make sense? Is that a reasonable approach?

Link to comment
https://forums.phpfreaks.com/topic/99494-random-image-replace-from-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.