There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.
Types
Accordion
A standard accordion
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.
A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.
Basic
A basic accordion does not add any extra formatting
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.
Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.
A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.
Variations
Fluid
An accordion can take up the width of its container
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.
Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.
A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.
Behaviors
Behaviors are accessible with javascript using the syntax:
open (index) | Opens accordion content at index |
close (index) | Closes accordion content at index |
toggle (index) | Toggles accordion content at index |
Form
An accordion can be used anywhere where content can be shown or hidden. For example, to show optional form fields.
Menu
An accordion can be used to create content drawers inside a menu
Initializing an accordion
After including accordion html in a page you can attach behaviors with javascript
Accordion Settings
Accordion settings modify its behavior
Setting | Default | Description |
---|---|---|
exclusive | true | Set to false to allow multiple sections to be open at the same time |
collapsible | true | Set to false to require an accordion to always have a section open |
duration | 500 | Duration in ms of opening animation |
easing | easeInOutQuint | EaseInOutQuint is included with accordion, for additional options consider jQuery easing) |
Callbacks
Callback settings specify a function to occur after a specific behavior.
Setting | Context | Description |
---|---|---|
onOpen | active content | Callback on element open |
onClose | active content | Callback on element close |
onChange | active content | Callback on element open or close |
DOM Settings
DOM settings specify how this module should interface with the DOM
Setting | Default | Description |
---|---|---|
namespace | accordion | Event namespace. Makes sure module teardown does not effect other events attached to an element. |
selector |
{
title : '.title',
content : '.content'
}
|
Object containing selectors used by module. |
className |
className : {
active : 'active'
}
|
Class names used to attach style to state |
Debug Settings
Debug settings controls debug output to the console
Setting | Default | Description |
---|---|---|
name | Accordion | Name used in debug logs |
debug | True | Provides standard debug output to console |
performance | True | Provides standard debug output to console |
verbose | True | Provides ancillary debug output to console |
errors |
error : {
method : 'The method you called is not defined.',
notFound : 'There were no elements that matched the specified selector'
}
|