Updated LoadRicoClient for asp and php, so all asp and php examples are working again...
[infodrom/rico3] / examples / html / accordion3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
5 <title>Rico</title>
6 \r
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});
14 });\r
15 </script>\r
16 \r
17 <link href="../demo.css" type="text/css" rel="stylesheet" />\r
18 <style type="text/css">\r
19 #OuterAccordion {
20   margin-top : 6px;
21   width: 500px;\r
22   font-size:small;\r
23 }
24 </style>
25 </head>
26
27
28 <body>
29 <h1>Rico Nested Accordions</h1>
30 \r
31 <p id='libname'>Base Library: <span id='BaseLib'></span>\r
32 </p>\r
33 \r
34 <div id="OuterAccordion">
35
36     <div>
37       <div>
38         Overview
39       </div>
40       <div>
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
45       and hovering.
46       </div>
47     </div>
48
49                 <div>\r
50                   <div>\r
51                         More Info (nested accordion)\r
52                   </div>\r
53                   <div>\r
54             <div id="NestedAccordion">\r
55                 <div>\r
56                   <div>\r
57                          Overview of ContentTransition base component\r
58                   </div>\r
59                   <div>\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
63                   </div>\r
64                 </div>\r
65                 <div>\r
66                   <div>\r
67                             Alternative HTML\r
68                   </div>\r
69                     <div>\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
74                   </div>\r
75                 </div>\r
76                 <div>\r
77                   <div>\r
78                             Alternative effects\r
79                   </div>\r
80                     <div>\r
81                     We will be discussing alternative transition effects here.\r
82                     Should be interesting.\r
83                   </div>\r
84                 </div>\r
85             </div>\r
86 \r
87         </div>\r
88                 </div>\r
89
90     <div>
91       <div>
92         Rico Code
93       </div>
94       <div>
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
97     <pre>
98   new Rico.Accordion( 'OuterAccordion', \r
99                       { panelHeight : 200, \r
100                         selectedIndex : 1 });\r
101   new Rico.Accordion( 'NestedAccordion', \r
102                       { panelHeight : 100 });\r
103     </pre>
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.
106       </div>
107     </div>
108
109
110     <div>
111       <div>
112         Important Note
113       </div>
114       <div>
115       <br>The accordion is very flexible.
116       However, you do have to make sure the header and content elements are structured properly.
117       <br>
118       </div>
119     </div>
120
121 </div>
122
123 </body>\r
124 </html>\r