I'm using the Adobe Accessible Mega Menu plugin and am looking to extend this, (basically add a function that can be called from another script).
I've looked into extending jquery plugins, javascript closures and various other threads on the subject and I can see how this works
I can also see a bunch of public attributes and methods (ln 695 on) however attempting to call these merely returns the jquery object?
Equally adding a function and attempting to call that doesn't seem to work?
I've added a function called testFunction which fires an alert and should (i think) be called :
$("nav:first").accessibleMegaMenu("testFunction");
but no luck far..
Does anyone know how I can add a function to the above script, that can be called from another script?
https://codepen.io/anon/pen/VjzkqE
edit: solved - functions need to be accessed through the prototype obj as in :
nav.accessibleMegaMenu.AccessibleMegaMenu.prototype.customFunction(param);