samedi 26 septembre 2020

Generate random images from user checkboxed selections

Hi I have two sets of code. The first one was made by a nice person on this site, and generates a random letter based on the selections checkboxed by the user.

The second is one I found online. It allows you to turn image links into checkboxes that can be checked and unchecked.

I am trying to combine these two codes so that I can have the program generate a random image (instead of a letter) based on an array of images (again instead of letters) that the user checkboxes. In short, I'm trying to get something like the first set of code that uses images instead of letters.

Then, the final thing I'm trying to do is add a range slider like so (https://www.w3schools.com/code/tryit.asp?filename=GJ5U82DC2JX9) underneath each image. I want the user to be able to use the slider to "weight" the frequency of each checked image in the final randomization (with a range of 0 to 10).

Here is the first program in running form:

https://www.w3schools.com/code/tryit.asp?filename=GJ5TXX8V9B7L

Here is the second program in running form:

https://www.w3schools.com/code/tryit.asp?filename=GJ5TXEQM6HVI

I have tried intuitively copying and pasting from one set to the other, but I cant seem to get it even close to working the way I'd like. As for the weighting part, I am at a loss.

Thank you for any and all help, and if this is beyond the scope of help for this site I apologize.




Aucun commentaire:

Enregistrer un commentaire