when using var inside a function, it will make the element "private". this is a hacker way to make Javascript work, while the true structure of the class does not get into Javascript. You need to either install it on the prototype of your function, or return an object
(function($) { $.fn.top_islides = function(){ var ajax_init = function(){ init_islides(); setTimeout(function(){picmove()},300); }; return { 'ajax_init': ajax_init };
or
(function($) { $.fn.top_islides = function(){
but in your case, you will not use the prototype, because you are not creating an instance of the new top_islides object, but rather accessing through jQuery, so the first option is your best bet.
pocesar
source share