$.fnと$.extendさえ押さえておけば自前のメソッドが作れます。
例えば下記はmyscrollというメソッドを作っています。
$.fnを付けて宣言し、$.extendで初期値を設定しています。
$.fn.myscroll = function(option) { var settings = $.extend({ speed: 1000}, option); $(this).click(function() { $('html, body').animate({ scrollTop: $(this.getAttribute('href')).length ? $(this.getAttribute('href')).offset().top-100 : 0 }, settings.speed); return false; }); return this; }; $(document).ready(function() { $('a[href^="#demo_"]').myscroll({ speed: 300 }); });
jQueryのいろんなプラグインも大体同じような書き方です。