Wednesday, April 21, 2010

jQuery plugins: default options

jQuery plugins should expose their default options as a global hash. This is useful if you want to always override the defaults in the exact same way across your entire site.

Most good plugins already do this, for example jQueryUI plugins do this. Here is the plugin code that will let you expose your defaults as a global variable:

No comments:

Post a Comment