• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Changing multiple images on a dropdown select?

Sophia

Senior member
I?m interested in making some color swatches where the available image thumbnails for color choices change based on what type of fabric the user selects from a dropdown menu. FabricA might have 5 colors, FabricB 10 colors, FabricC 25 colors, etc.

I don?t particular know javascript, however I understand how to swap a single image at a time (example: http://www.rgagnon.com/jsdetails/js-0057.html )

But what I?d really like to do is load a set of images based on the dropdown select. Can I tell it to load an array of images on select or is that too easy 😉 ?
 
The first thing I notice is that that example has some really bad javascript. Eval for an index lookup! It should be an array in that example.

We had a thread about animating small images recently. It's really slow with hundreds of copies of one image; but if you take a look at the source code, it might give you some ideas.
 
Should be a straightforward multidimensional array. The fabric drop down changes the first dimension, and the color drop down changes the second. With a bit of javascript, it's really no big deal.

You should consider what happens to color on a fabric change though. Does it always revert to a default color, does it attempt to keep the current color if it's in both, and revert to a default if it's not, or what?
 
Back
Top