1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
7 <script src="LoadRicoClient.js" type="text/javascript"></script>
\r
8 <script type='text/javascript'>
\r
9 Rico.onLoad( function() {
\r
10 var label=Rico.$('BaseLib');
\r
11 if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;
\r
12 new Rico.Accordion( 'OuterAccordion', {panelHeight:200, selectedIndex: 1});
\r
13 new Rico.Accordion( 'NestedAccordion', {panelHeight:100});
17 <link href="../demo.css" type="text/css" rel="stylesheet" />
\r
18 <style type="text/css">
\r
29 <h1>Rico Nested Accordions</h1>
31 <p id='libname'>Base Library: <span id='BaseLib'></span>
\r
34 <div id="OuterAccordion">
41 <br>This example illustrates how to use the Rico.Accordion behavior to transform a set of
42 divs into a first class accordion component.<br><br>
43 Rico.Accordion is actually a very simple component built off of Rico behaviors and effects.
44 It adds the necessary event handlers on the respective divs to handle the visual aspects of expanding, collapsing
51 More Info (nested accordion)
\r
54 <div id="NestedAccordion">
\r
57 Overview of ContentTransition base component
\r
60 The Accordion derives from a base component that applies and manages
\r
61 behaviors and effects. The effects can be defined at the extended class.
\r
62 This approach results in a very flexible way of managing
\r
70 Since the accordion does not parse the html, it can be constructed much looser
\r
71 than in previous versions. The base ContentTransition can be used to quicly build
\r
72 components such as tabs, master details, and many application specific behaviors.
\r
73 We will be providing examples of building your own soon.
\r
81 We will be discussing alternative transition effects here.
\r
82 Should be interesting.
\r
95 <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
96 object and pass the id of the outer accordion div to it. Since there are two accordions in this example, we create two objects:
\r
98 new Rico.Accordion( 'OuterAccordion',
\r
99 { panelHeight : 200,
\r
100 selectedIndex : 1 });
\r
101 new Rico.Accordion( 'NestedAccordion',
\r
102 { panelHeight : 100 });
\r
104 Panels are numbered starting with 0. The "selectedIndex:1" option
\r
105 ensures that the panel with the nested accordion is open by default.
115 <br>The accordion is very flexible.
116 However, you do have to make sure the header and content elements are structured properly.