How do you create a plugin that does not require a selector, for example:
$.pluginName();
From this:
(function($)
{
$.fn.pluginName = function(options)
{
};
})(jQuery);
Instead of using this (to prevent other libraries from colliding $):
jQuery.pluginName = function(name, value, options)
{
};
Because if I do it: $.pluginName(), the Firebug tells me that $.pluginName()is not a function if I do not add it: $.('a selector goes here').pluginName();.
source
share