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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With