studiopress / genesis-simple-faq

An accessible, performant WordPress plugin that adds FAQ management and rendering to your Genesis child theme.
10 stars 7 forks source link

Answers are hidden if JavaScript is disabled. #31

Closed timothyjensen closed 6 years ago

timothyjensen commented 7 years ago

If a user has JS disabled or if there is a JS error on the site, then answers would not be made visible on click. Granted, this would be a rare occasion, but it might be worth showing answers by default and hiding them via JS vs the other way around.

The tradeoff with this suggestion is that there would be a brief flash on the page where answers are visible before they become hidden.

cjkoepke commented 7 years ago

Actually would be really easy to default FAQ's to an open state if JS is turned of. Great idea!

cjkoepke commented 7 years ago

@nickcernis I've added support for non-JS. Simply hides the toggle button and shows the headers along with their descriptions by default.

nickcernis commented 7 years ago

Looks good.

JS enabled

test_faq_page

JS disabled

test_faq_page