x

Selecting Thumbnail product image does not correspond to drop down menu option

Okay, we all know this problem has not been addressed by weebly, so I found a script that does or did. I recently added a new item and used the same script but it does not work.  Very odd, because the same script on the older item pages still works.  Maybe someone could take a peek at this. www.nami-creations.com. The new non-working item on

https://www.nami-creations.com/store/p61/Test_item.html#/   

Here's the script that used to work.

<script>
var items = [
{id: "wsite-com-product-images-secondary-1", index: 1}, // Test item1
{id: "wsite-com-product-images-secondary-2", index: 2}, // Test item2
{id: "wsite-com-product-images-secondary-3", index: 3}, // Test item3
{id: "wsite-com-product-images-secondary-4", index: 4}, // Test item4
];
for(var i=0;i<items.length;i++)
{
var item = items[i];
var e = document.getElementById(item.id);
if( e==null ) continue;

e.benItem = item;
e.benHandler = function(){
var s = document.getElementById("wsite-com-product-option-Fabric");
s.selectedIndex = this.benItem.index;
s.dispatchEvent(new Event("change"));
};
e.removeEventListener("click", e.benHandler);
e.addEventListener("click", e.benHandler);
}
</script>

562 Views
Message 1 of 3
Report
2 REPLIES 2

Okay,  I solved my own problem.  I just needed to change 

wsite-com-product-option-Fabric”    to my new items option name. Sorry for the oversight. 

558 Views
Message 4 of 3
Report
Square

Thank you for sharing your solution 😊

535 Views
Message 4 of 3
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.