- Loading...
- No images or files uploaded yet.
|
|
Accordion
type: widget realease: 1.5 status: complete documentation: http://docs.jquery.com/UI/Accordion demo: http://jqueryui.com/demos/accordion
1 - Description:
An expandable/collapsible content pane. Applicable when content must be displayed within limited space. Accordions are most commonly seen in the stacked vertical style on the web, but a horizontal accordion, where clickable tabs are rotated 90 degress to the left, should also be considered (see a good example at Boston University's site: http://www.bu.edu/). We'd need to determine how to display the text for a horizonal accordion since rotating text is not possible in HTML and stacking each letter of the label on a separate line looks odd.
An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that. If you are looking for a widget that allows more than one content panel to be open, don't use this.
2 - Visual Design:
3 - Functional Specifications/Requirements:
An accordion consists of a list of header/content pairs. Headers are always visible, while at most one content panel is visible. Switching between content panels works by clicking headers or navigating with the keyboard - when the accordion has focus, key up/down change focus between headers, enter activates the content of the selected header.
4 - Markup & Style:
4.1 Initial markup examples
<div id="accordion"> 4.2 Recommended transformed HTML markup demo with html and css:
http://jquery-ui.googlecode.com/svn/trunk/tests/static/accordion/default.html http://jquery-ui.googlecode.com/svn/trunk/tests/static/accordion/dl.html http://jquery-ui.googlecode.com/svn/trunk/tests/static/accordion/ul.html
4.3 Markup & style browser QA status
As of 12/12/08, static markup for this widget renders correctly in the following browsers. (Correct rendering = true to design, with only small differences across browsers owing to differences in support of rounded corners, and native OS form element and font rendering.)
Please update this list as more browsers / platforms are tested.
4.4 Accessibility recommendation
Q: how accessible is the current version?
4.5 CSS & Theme (cascades from framework css)5 - Latest version of plugin:http://jquery-ui.googlecode.com/svn/trunk/demos/accordion/default.html
6 - Open issues being discussed
There are two modifications worth discussing.
Both heavily affect interaction: Cookie persistence makes the accordion remember its own state across pages or page reloads, hoverintent enables a much better interaction then both click and mouseover events, and in combination with click, still works on systems like the iPhone.
3. The accordion headers need 3 elements: container, icon span, and text container. Can we assume the container (h3 in the example above), and text container will be provided in initial markup? Should the text container always be an anchor for accessibility? How does the current plugin enforce these things?
Considering that autoHeight, fillSpace and clearStyle are all exclusive, they should probably be merged into a single option with enumerated values, eg. height: "auto", "fill", "clear".
The navigation and navigationFilter options are specialized active-variants, without reusing any of the existing infrastructure. A high price for a small value.
The active-option and the activate-method do the same thing - the method could be removed in favor of the option.
|
Comments (7)
Kevin Dalman said
at 6:10 pm on Dec 12, 2008
For cookie persistence, has consideration been given to either:
1. A framework for persistence in the ui.core, or
2. Standardized methods in the UI API for saving/loading persisted data
An example for #2 is a read/write "state" method and corresponding option:
SAVE the state
$.cookie( "accordion1", $("elem").accordion( "state" ) );
LOAD the state
$("elem").accordion({
active: 0 , // default if no saved-state
state: $.cookie( "accordion1")
});
This is the equivalent of 'extending' the options with the saved-state data
Or, it could also 'reset' state after a widget is initalized:
LOAD/RESET the state
$("elem").accordion( "state", $.cookie( "accordion1") );
If desired, the state data can still be used selectively:
var savedState = $.cookie( "accordion1");
$("elem").accordion({
active: savedState.active ,
other: savedState.other
});
This applies equally to tabs or any widget where persistence is desirable. A consistent API for saving/loading state seems preferable to each widget doing its own thing.
Jörn Zaefferer said
at 5:47 am on Dec 13, 2008
I can see that being useful for tabs (remember active tab) and for dialog (remember dialog position and size).
Paul Bakaus said
at 2:59 am on Dec 15, 2008
Safari iPhone: Content overlaps below the titles
RichCaloggero said
at 2:04 pm on Jan 8, 2009
http://jquery-ui.googlecode.com/svn/trunk/demos/accordion/
** • default.html
The blurb at the end of the page says:
"... The HTML code is a series of headers (H3) and content ..."
I see no headings on this page.
* Very Odd Problem
The controls for opening/closing the various sections seem to be links (anchors) -- so the screen reader says. However, only the first seems to be tabbable.
I grabbed the initial HTML from the document and dropped it into a test file and the structure displayed correctly, so it must be something about how the widgit processes the initial markup that's confusing Jaws. WHat exactly is hidden - I assume its the divs just following the h3 elements that are hidden/shown. I assume the headings are never hidden. Its odd that Jaws doesn't see the headings and doesn't let you tab among the anchors...
* I think I Understand ...
Are the triggers here marked up as aria tab controls? I thnink this is the issue here. The screen reader stil doesn't know how to properly deal with aria. Maybe removing the aria stuff might help here? This is one of the simpler widgits and may not need aria, at least for now.
** • collapsible.html
Interestingly, if you collapse all the sections, Jaws now only lets you tab to the section 4 link. So, if a section is expanded, Jaws only lets you tab to that trigger; if all are collapsed then Jaws only lets you tab to the last trigger. Again, if aria is used to make these things look like tabs in a tabbed interface, try removing the aria attributes and I'll test it again.
Andrew Powell said
at 2:18 pm on Jun 19, 2009
As per the specification: "active option and activate method accept the same argument, when collapsible: true, activate(false) closes the accordion, otherwise nothing happens"
As reported by http://dev.jqueryui.com/ticket/4618 - My assumptions are;
- if 'activate' method is set, that should affect the 'active' option by updating it with the index (or index of the element) passed to with the 'activate' method.
- ('option', 'active', n) should behave like 'activate'.
Going off of both of those assumptions, the demo would appear to be broken according to that ticket.
If someone can verify this, I'll fix these issues this weekend.
Scott González said
at 2:55 pm on Jun 19, 2009
Yeah, the active option should update as the state of the accordion changes.
Jörn Zaefferer said
at 4:54 pm on Jun 19, 2009
+1
You don't have permission to comment on this page.