i use jquery for a long time and thinking of creating a plugin myself. but no matter how easy the tutorial was, i cant really grasp the idea of chaining. suppose i have this very simple plugin....
(function($){
$.test = function(){
$.test.one = function(){ alert("1");};
$.test.two = function(){ alert("2");};
return this.each(function(){
(what to write here????)
});
};
})(jQuery);
what i want to accomplish is, when i call like eg
var myplugin = $.test();
myplugin.one().two();
but it returns me errors. sorry, i tried many times googling simple tutorials but i cant get this working