There are even two small plugins that enable you to do it quite easily: http://groups.google.com/group/jquery-dev/browse_thread/thread/b2f784b7575456dc/0cd276379f8a2f7d?show_docid=0cd276379f8a2f7d
On Dec 13, 9:27 pm, Marion <marion.newlev...@gmail.com> wrote: > Hi Mike, > > Thanks! all good suggestions. I went with > $('#someid').myPlugin({ > doThis: ..., > doThat: ... }); > One entry point, and lets me doThis and doThat both, which turned out > to be useful. > > I'm still curious whether my original syntax could be made to work. I > suspect the answer is "not easily". > > Marion > > On Dec 13, 5:14 am, Mike Alsup <mal...@gmail.com> wrote: > > > > I'm trying to create a plugin with two entry points. You would use it > > > like this: > > > > $('#someid').myPlugin.doThis(options); > > > $('#anotherid').myPlugin.doThat(options); > > > How about one of these approaches instead: > > > $('#someid').myPluginDoThis(options); > > $('#anotherid').myPluginDoThat(options); > > > or > > > $('#someid').myPlugin('doThis', options); > > $('#anotherid').myPlugin('doThat',options); > > > or > > > $('#someid').myPlugin({ > > action: 'doThis' > > /* other options */}); > > > $('#anotherid').myPlugin({ > > action: 'doThat' > > /* other options */ > > > });