Did you know ... | Search Documentation: |
Pack weblog -- prolog/nav/accordion.pl |
Works with library(http/html_write)
Uses the JQuery library
accordion has a structural similarity to the html ordered list tag
<OL> <LI>First Thing</LI> <LI>Second Thing</LI> </OL>
in that an accordion expects a list of \accordion_section//2 inclusions
Example:
thing_with_accordion --> html([ h2('All of Acmes Fine Products'), \accordion([sortable(true)], [ \accordion_section('Acme Products #133 Portable Hole', [ p(img(src='portablehole.png', []), 'The Best hole for the money'), p('Not recommended for use by coyotes') ]), ... \accordion_section('Acme Products #17 Nuclear Bomb', [ p(img(src='nuke.png', []), '27Kiloton Nuclear Bomb'), p('The best road runner blaster on themarket') ]) ])
Options:
collapsible(true)
.active(atom)
is required. Inactive headers will receive
the atom as an additional class.active(atom)
is required. Inactive headers will receive
the atom as an additional class.height(fill)
. To consume only as much space as is needed for content, set height(content)
(the default).
NOTE: If the containing box is resized after initial draw
$( "#accordion" ).accordion( "refresh" );
must be called. See http://jqueryui.com/accordion/#fillspace
sortable(true)
is used, then each group of sections to be drug
together must be surrounded by
div(class=group, ... accordion_sections ... )
accordion
). Accordions sharing a page need unique IDs.Note: currently not implemented.