(function($){
$.fn.the_func = function() {
function my_func(){
alert('it works');
}
my_func();
// other code
};
})(jQuery);
$(window).load(function(){
my_func(); // This way?
$.the_func().my_func(); // Or this way? No?
$.the_func.my_func(); // No?
// ?
});
$(document).ready(function(){
$('div').the_func();
});
How can I call this function outside the function which wraps it?
I want to call my_func() like in this code-example.
(the window-load function is just an example.)
I want to call my_func() from "everywhere" without executing other functions or code within the_func(). BUT I want to use the variables of the_func().
With my_func() I want to update values which are stored in parameters of the_func().
$("div").the_func("my_func")? Would that work? I don't mean with your current solution...I mean if you would be okay with that syntax, because that's the way I know hot to structure it to make it work as you want