- Loading...
- No images or files uploaded yet.
|
|
Coding standardsNOTE: 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
.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:
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 (2)
Scott González said
at 6:59 am on Jun 30, 2009
no Hungarian notation
Scott González said
at 10:24 am on Jul 15, 2009
don't use .data() for plugin properties
You don't have permission to comment on this page.