How does one go about making a custom function to append to the jQuery selector? Something that would look like:
$('.my_class').my_function();
How does one go about making a custom function to append to the jQuery selector? Something that would look like:
$('.my_class').my_function();
You want to add the function to jQuery.fn
(which is a reference to the jQuery object prototype). For more details check out:
http://docs.jquery.com/Plugins/Authoring
An example\stub:
(function($){
$.fn.my_function = function(){ ... };
})(jQuery);