/    Sign up×
Community /Pin to ProfileBookmark

hiding content via JS without a "flash"

i have nested radio buttons. the top most button “opens” (display:block) the nested list which is hidden (display:none) via javascript onload(). The problem is the page loads with the nested list displayed for a split second before it hides it. I would just use inline/linked css to hide the element, but i want it to be accessible to screen readers. is there a solution to stop the quick flash of the nested list on page load?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJan 09.2008 — The only solution is the one you mention. Either live with the "flash" or send the screen-reader to an alternate page without your nested radio button stuff.
Copy linkTweet thisAlerts:
@FlukeyJan 09.2008 — Check if javascript is disabled, if it is then display different content.
Copy linkTweet thisAlerts:
@TJ111Jan 09.2008 — I'm not sure how screen readers handle it, but you could just set the style to display:none or visibility:hidden. If that effects screen readers, maybe you can try just setting the height to 1px initially. It will minimize the "flash" at least.
×

Success!

Help @bcamp1973 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...