(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();
});
我如何可以调用它包装它的功能外这个功能呢?
我想调用my_func()
就像这个代码示例。
(窗口负载函数仅仅是一个例子。)
我想调用从“无处不在” my_func()
无内the_func()
执行的其他功能或代码。但我想使用the_func()
的变量。
With my_func()
我想更新存储在参数the_func()
中的值。的Jquery/JS:调用jQuery的功能的功能外jQuery的功能
如何将它称为'$(“div”)。the_func(“my_func”)'?这会起作用吗?我不同意你的当前解决方案的意思是......我的意思是,如果你会好起来的与语法,因为这是我知道的热来构建它,使你想 – Ian