I managed to fix this by introducing an 'If' statement after the image list, as follows: if (answer_apple == answer_apple) { // Swap image according to answer (zero indexed, thus -1) img_apple[0].src = images_list_apple[answer_apple - 1] }All of the sliders now appear correctly on the same page. The issue was that whenever I clicked on a slider the remaining sliders all returned a "NaN" result, and so they were unable to load an image.Hope this helps!Chris
Nami Thank you so much for your incredibly helpful thread! I'm attempting to create a task whereby people can essentially pick their preferred portion size of a variety of different foods. The code you've provided works perfectly if all of the sliders are on separate pages, but if I put them all on the same page it stops working. I've changed the HTML so that each image has a unique ID, and changed the JS 'eq' values for each question, but it still doesn't seem to be working. If it helps, I have six sliders on the same page, each representing a different food. I created the first slider using your code, before copying the question and changing the image/ items in the image list. Hoping you can help!
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.