I'm having a hard time figuring this out. I've added the following JavaScript inline to a Shopify section:
let hash = window.location.hash;
let tab = document.querySelector(hash + " + div #tab-" + urlParams.tab);
tab.checked = true;
What it does: switches between accordion tabs based on a URL parameter. The accordion tabs were built using checkboxes and styled with CSS according to the "checked" item. Three things:
el.checked on each of the tabs reveals that the
correct one is checked after page load (the others are false).Is there maybe something weird that Shopify does? I don't have a ton of Shopify experience.