NOTE: Content from the old Development page has been ported into this page to avoid any confusion. This page is in-progress and we'll be making additions frequently so please check back for updates. Please note any questions or claifications here so they can be answered.
General Guidelines
- No browser checks (unless completely necessary) - use jQuery.support instead
- Plugins must work regardless of what options are passed to init. All options are truly optional and may be changed at any time.
- Use jQuery.ui.keyCode for all keyboard events.
- Do not abbreviate variable names; the bytes will be saved when compressed.
- Use curly braces for all if statements.
- do not modify options that a user passes in, except when they are used to reflect the state of the plugin
- all default values must be explicit
- no default value should be undefined. At the least it should be null or false
.noConflict() compliance
Wrap plugins in a closure that passes jQuery in as a parameter. Inside the closure, only reference jQuery through the parameter variable.
(function($) {
// inside here only reference $, not jQuery
})(jQuery);
passing elements as options or parameters
Whenever a user can specify an element, they should be able to provide any of the following:
- DOMElement
- array of DOMElement's
- jQuery object
- function that returns any of the above
- Is there a common set of parameters that would be passed to this function?
- Is there a common context that would be set for this function?
getting/setting options after init
add notes about how to listen to options
callbacks
add notes about how to trigger callbacks and what to pass in the ui object
specifying icons
add notes about how to specify which icons to use, e.g., which close icon.
specifying events
add notes about how to specify which events should trigger an action
- click, ctrl+click, mouseover
applying CSS classes
- applying hover states
- applying focus states
Comments (0)
You don't have permission to comment on this page.