[jQuery] Plugin Help
[jQuery] Plugin Help
I apologize if this seems noobish.
So let's say I want to write my own plugin (who woudln't?)
So I spec it out like this:
(function($) {
$.fn.myAwesomePlugin = function(options) {
var defaults = {
[some defaultish stuff here]
};
var options = $.extend(defaults,options);
function rockOn() {
// I want to call another function in myAwesomePlugin here
};
})(jQuery);
How do I call the other function in rockOn? Say it's called
startRockin.
Do I do $.myAwesomePlugin.startRockin?
Do I simply do startRockin?
Would it be $this.startRockin?
I've been searching for this and so far I haven't seen much in any of
the tutorials I've found... and the plugins I have to dig through
don't seem to either: 1) have multiple functions 2) have those
functions call each other.
Thanks!