DrY Accordion component
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot addition of Template:ArticleMetaData) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Fix categories) |
||
| (One intermediate revision by one user not shown) | |||
| Line 1: | Line 1: | ||
| + | [[Category:Symbian Web Runtime]][[Category:UI]] | ||
{{ArticleMetaData | {{ArticleMetaData | ||
|sourcecode=[[Media:DrY Accordion.zip]] | |sourcecode=[[Media:DrY Accordion.zip]] | ||
| Line 21: | Line 22: | ||
Following code snipped shows on how the According control can be used | Following code snipped shows on how the According control can be used | ||
| − | < | + | <code javascript> |
dojo.require("dry.Accordion"); | dojo.require("dry.Accordion"); | ||
| Line 49: | Line 50: | ||
var acc = new dry.Accordion({domIds: domIdsData2,styleTweaker: styleTweaker,expanded: expanded,collapsed: collapsed,}); | var acc = new dry.Accordion({domIds: domIdsData2,styleTweaker: styleTweaker,expanded: expanded,collapsed: collapsed,}); | ||
| − | </ | + | </code> |
The construction for the According takes domIds struct as a first argument, with this struct following variables can be defined: | The construction for the According takes domIds struct as a first argument, with this struct following variables can be defined: | ||
| Line 64: | Line 65: | ||
== Examples == | == Examples == | ||
| − | + | * Component browser at [http://dev.drjukka.com/DrY/ de.DrJukka.com/DrY/] | |
| − | Component browser at [http://dev.drjukka.com/DrY/ de.DrJukka.com/DrY/] | + | * WRT example at Wiki: [[:File:DrY Accordion.zip|DrY Accordion.zip]] |
| − | + | ||
| − | WRT example at Wiki: [[:File:DrY Accordion.zip|DrY Accordion.zip]] | + | |
[[DrY Article Index|Go to DrY Index]] | [[DrY Article Index|Go to DrY Index]] | ||
| − | |||
Latest revision as of 06:47, 5 July 2012
Article Metadata
Code Example
Source file: Media:DrY Accordion.zip
Article
Created: symbianyucca
(16 May 2010)
Last edited: hamishwillee
(05 Jul 2012)
Following code snipped shows on how the According control can be used
dojo.require("dry.Accordion");
var domIdsData = [{
"id": "first one",
"toggle": "firstTogle",
"content": "firstContent",
"expanded":true,
"animated": true,
},{
"id": "second one",
"toggle": "secondTogle",
"content": "secondContent",
"expanded":false,
"animated": true,
"animDelay": 1500
}];
function expanded(id){
console.log(id + " expanded");
}
function collapsed(id){
console.log(id + " collapsed");
}
var acc = new dry.Accordion({domIds: domIdsData2,styleTweaker: styleTweaker,expanded: expanded,collapsed: collapsed,});
The construction for the According takes domIds struct as a first argument, with this struct following variables can be defined:
- "id": internal Id fort he According, used also as Title fort he Accordion,
- "toggle": Dom-ID name fort he div where the Accordion is to be placed in,
- "content": Dom-ID name fort he div where the Accordion collapsing is to be placed in,
- "expanded": true/false, defined initial collapsing state,
- "animated": true/false, identifies whether collapsing/expanding is done with animation,
- "animDelay": delay fort he collapsing/expanding animation.
The second argument is styleTweaker that would be used fort he themes, and expanded/ collapsed are callback functions to identify when the expanding/collapsing has finished.
Examples
- Component browser at de.DrJukka.com/DrY/
- WRT example at Wiki: DrY Accordion.zip

