The ne开发者_如何学Gow HTML5 details and summary elements, are currently implemented in Chrome 12.
I find one thing that is concerning me and I would like to hear your thoughts on the matter.
When the open
attribute is set, any child nodes besides the summary element, "content" of the details element are removed from the document flow.
I want to increase usability by giving the user a clear visual cue.
So I am preventing the default behavior in JavaScript.
When the summary element is toggled (click or keyboard), a slide down animation starts if the details element is closed or a slide up animation starts when the details element is open.
If the element is open, the open attribute is removed when the animation is finished. Otherwise, the content will be invisible immediately while the animation is still running.
This is all fine but what about accessibility? Folks using assistive technology. They will have to wait the duration of the slide up animation before they have a confirmation that the details element is closed (because only then, the open attribute is removed)?
Why don't you set aria-expanded
to false just before the closing animation?
Make your pages functional without any script at all, that will help usability a lot. Only add script where it enhances usability - things that slide up/down or fade in/out may look cool the first time, but after making users wait several times for effects to do their thing before they can access the content being revealed, it quickly becomes tiresome.
精彩评论