Accordion-Blocks
Accordion-Blocks copied to clipboard
Search in page - use hidden=until-found
Problem: Content in accordions can't be found by searching within the page (CTRL + F).
I just read Making collapsed content accessible with hidden=until-found at Chrome Developers where the suggested solution is to use hidden=until-found
. This works in Chromium derivates as well as in a current Firefox version. The article suggests using if (!(‘onbeforematch' in document.body)) { // expand all hidden content }
if an even broader browser support is aimed for.
It would be great if this would be supported by this very useful plugin.
Maybe also interesting: The article says "In addition to allowing find-in-page search on hidden regions, this feature will allow this hidden content to be accessible to search engines. Google Search will even form links that scroll to the revealed fragment.". I'm not sure this is a matter, but it seems to be true that Google results currently don't show the context if matched in a hidden accordion.