1. It has to be accessible in the global scope somewhere. For example:
// file1.js
$(function() {
function hello() {
alert("Hello, world!");
}
// ...
});
// file2.js
$(function() {
hello();
});
2.If you declared
menuHoverStart inside a function (the anonymous one you pass to the ready), that limits its scope to that function and you cannot call it from outside that function. It doesn't do anything there, so there is no need to hold off on defining it until the ready event fires, so you could just move it outside the anonymous function, make this function available in the global scope (or through any object that is available in the global scope). That said, globals are worth avoiding, so you might prefer to define a namespace (to reduce the risk of name collisions) and hang the function off that.
var MYNAMESPACE = {}; // In the global scope, not in a function // The rest can go anywhere though MYNAMESPACE.menuHoverStart = function (element, topshift, thumbchange) {
//code
}