I can make one that has functionsI can make one that uses options
but I CANT DO BOTH AND I'm going nuts!
I've googled everywhere but no one has a decent example of making a plugin that operates like say the jqueryui.dialog one
I don't really need events, yet, but I'd like to say somthing like
- myPluginSettings = {
- option1: 'option',
- option2: 'option'
- }
- $('div').myPlugin(myPluginSettings); // initiate plugin
- // Somtime later //
- $('div').myPlugin('action'); // initiate action (like open, close, show, whatever)
Everyone's tutorials seem to cover one thing or the other, plugin with settings, or with methods, none of them show me how to incorporate both the way jqueryui plugins do and reading over their codejust confuses me even more!
Please help? Why does NO ONE have a good jquery plugin tutorial? Everyone I've seen is crap, they don't explain anymore than the basic api.doc one does.
Come on people, someone must know a good way to write an understandable tut about making full use of jquery plugins? After all, there are hundreds of them, so why has no one bothered to write a decent tut!?
UPDATE! I believe i have figured it out and will now be posting my plugin idea "jqCursor" in (hopefully) proper place on forum to get advice about it!