Types
Content Dimmer
A dimmer can display content
Dog Photos
Your poodle photo uploaded successfully!
Your poodle photo uploaded successfully!
Page Dimmer
A dimmer can be formatted to be fixed to the page
States
Active
An active dimmer will dim its parent container
Disabled
A disabled dimmer cannot be activated
Variations
Dimmer
Simple Dimmer
A dimmer can be controlled without javascript
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Inverted Dimmer
A dimmer can be formatted to have its colors inverted
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Usage
Dimming a section
Any element can be dimmed using a dimmer.
Showing a specific dimmer
If a dimmer is already included on the page, instead of calling dimmer on the section you would like to dim, you can can invoke behaviors directly on the dimmer.
Display
You can display a dimmer by either invoking dimmer show on a section or a dimmer itself. If you choose to dim a dimmable section, a dimmer will automatically be created.
Behavior
All the following behaviors can be called using the syntax $('.foo').dimmer('behavior name', argumentOne, argumentTwo)
add content (element) | Detatches a given element from DOM and reattaches element inside dimmer |
show | Shows dimmer |
hide | Hides dimmer |
toggle | Toggles current dimmer visibility |
get duration | Returns current duration for show or hide event depending on current visibility |
get dimmer | Returbns DOM element for dimmer |
has dimmer | Returns whether current dimmable has a dimmer |
is dimmer | Whether current element is a dimmer |
is dimamable | Whether current element is a dimmable section |
is active | Whether section's dimmer is active |
is animating | Whether dimmer is animating |
is page | Whether dimmable section is body |
is enabled | Whether dimmer is not disabled |
is disabled | Whether dimmer is disabled |
is page dimmer | Whether dimmer is a page dimmer |
set active | Sets page dimmer to active |
set dimmable | Sets an element as a dimmable section |
set dimmed | Sets a dimmable section as dimmed |
set page dimmer | Sets current dimmer as a page dimmer |
set disabled | Sets a dimmer as disabled |
Settings
Dimmer Settings | ||
---|---|---|
closable | true | Whether clicking on the dimmer should close it automatically |
duration |
duration : {
show : 500,
hide : 500
}
|
Animation duration of dimming. If an integer is used, that value will apply to both show and hide animations. |
Callbacks | ||
---|---|---|
onInit | None | Callback after a dimmer html is generated. |
onShow | None | Callback after a dimmer section is shown. |
onHide | None | Callback after a dimmer section is hidden. |
UI Module Settings | ||
---|---|---|
Name | Dimmer | Name used in debug logs |
debug | True | Provides standard debug output to console |
performance | False | Provides standard debug output to console |
verbose | False | Provides ancillary debug output to console |
namespace | dimmer | Event namespace. Makes sure module teardown does not effect other events attached to an element. |
errors |
errors : {
method : 'The method you called is not defined.'
}
|