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
10 Rico.loadModule('Accordion');
\r
12 Rico.onLoad( function() {
\r
13 var label=Rico.$('BaseLib');
\r
14 if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;
\r
15 new Rico.Accordion( 'OuterAccordion', {panelHeight:200, selectedIndex: 1});
\r
16 new Rico.Accordion( 'NestedAccordion', {panelHeight:100});
20 <link href="../demo.css" type="text/css" rel="stylesheet" />
\r
21 <style type="text/css">
\r
32 <h1>Rico Nested Accordions</h1>
34 <p id='libname'>Base Library: <span id='BaseLib'></span>
\r
37 <div id="OuterAccordion">
44 <br>This example illustrates how to use the Rico.Accordion behavior to transform a set of
45 divs into a first class accordion component.<br><br>
46 Rico.Accordion is actually a very simple component built off of Rico behaviors and effects.
47 It adds the necessary event handlers on the respective divs to handle the visual aspects of expanding, collapsing
54 More Info (nested accordion)
\r
57 <div id="NestedAccordion">
\r
60 Overview of ContentTransition base component
\r
63 The Accordion derives from a base component that applies and manages
\r
64 behaviors and effects. The effects can be defined at the extended class.
\r
65 This approach results in a very flexible way of managing
\r
73 Since the accordion does not parse the html, it can be constructed much looser
\r
74 than in previous versions. The base ContentTransition can be used to quicly build
\r
75 components such as tabs, master details, and many application specific behaviors.
\r
76 We will be providing examples of building your own soon.
\r
84 We will be discussing alternative transition effects here.
\r
85 Should be interesting.
\r
98 <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
99 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
101 new Rico.Accordion( 'OuterAccordion',
\r
102 { panelHeight : 200,
\r
103 selectedIndex : 1 });
\r
104 new Rico.Accordion( 'NestedAccordion',
\r
105 { panelHeight : 100 });
\r
107 Panels are numbered starting with 0. The "selectedIndex:1" option
\r
108 ensures that the panel with the nested accordion is open by default.
118 <br>The accordion is very flexible.
119 However, you do have to make sure the header and content elements are structured properly.