The problem is the following. Theres is a function custom jquery function with another function inside, f.e.:
$.fn.slides = function(args){
function foo(args){
}
}
My question is now: How can I call the method foo.
Keys with an Fn key or F Lock provide two sets of commands for many keys. This includes the top row of standard function keys (F1–F12). Standard commands are labeled on the front of the keys (such as F3). Alternate commands are labeled on top of the keys (such as Redo).
The function keys or F-keys on a computer keyboard, labeled F1 through F12, are keys that have a special function defined by the operating system, or by a currently running program. They may be combined with the Alt or Ctrl keys.
Press fn and the left shift key at the same time to enable fn (function) mode.
Method 1. Toggle the Fn Lock key All you have to do is look on your keyboard and search for any key with a padlock symbol on it. Once you've located this key, press the Fn key and the Fn Lock key at the same time. Now, you'll be able to use your Fn keys without having to press the Fn key to perform functions.
foo
is not a method. It is a local function. There is no way to access it from outside the function in which it is defined unless you modify that function to expose it.
For example (and I do not recommend creating globals, you should probably attach the function to some other object):
$.fn.slides = function(args){
function foo(args){ }
window.foo = foo;
}
You can't call it from outside the function, unless you return an object which has foo
attached to it, something like this:
$.fn.slides = function(args){
this.foo = function (args){
}
return this;
}
$('blah').slides(args).foo(args);
Inside the function you can use it as a regular function:
$.fn.slides = function(args) {
function foo(args) {
}
foo(args);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With