I’ve written a simple jQuery plugin, but I’d like to make it more advanced so I can do things like:
$.myplugin.close();
$.myplugin.open();
$.myplugin.next();
$.myplugin.prev();
How can I write a plugin that can be called like this?
————————-Updated————————-
Thanks @Craig MacGregor, appreciate it.
But to call the function it need to be like below
$(this).myplugin.load();
You can assign an object to “myplugin” like so: