I have the following function:
$("#myDiv").myFunc({ initDelay: -1, delay: 1000 });
I have another function in another .js file:
$.fn.setRandomDelay = function(){
return Math.random() * (4500 - 1500) + 1500;
};
I want to set the delay in the first function inline. Something like this:
$("#myDiv").myFunc({ initDelay: -1, delay: setRandomDelay()});
But this won;t work. Is there a way to do this?