I’d like to use maps inside accordion blocks where you click a link and the map unfolds open. The issue so far with this using different accordion blocks is only a tiny corner of the map shows up when unveiled. I’m guessing it has to do with it not being able to render while closed. Is there some sort of work around for this?
You’re right about the cause (hidden elements have no size). There’s unfortunately no general workaround, because all accordions, tabs, etc. work differently and have different events. But there’s an example here that can be tailored to your specific case:
I can confirm the accordion block (Accordion Blocks by Buchanan) uses JQuery but I’m a little lost as to where I would put the code you pointed me in the FAQ. Where would I pop it in?
That script won’t work as-is, it’s an example for jQuery tabs and other controls usually have different event names for when they open. I checked the accordion documentation, but I didn’t see any events listed. If you’d like to send a URL with a map & accordion on it I’ll have a quick look and see if I can guess.
Good news: I played around with a few accordion blocks and found that Kadence’s version handles folded up maps properly without any coding needed, yay!
Here’s what it looks — click the map link below the photo: Link