[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-30 Thread tres
@samer Thanks @anyone Let me know if you have any questions. On Jun 24, 9:54 pm, Samer wrote: > @tres > Nice plugin > > On Jun 23, 7:34 pm, tres wrote: > > > > > Check this > > thread:http://groups.google.com/group/jquery-dev/browse_thread/thread/664cb8... > > > I've written a plugin to a

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-24 Thread Samer
@tres Nice plugin On Jun 23, 7:34 pm, tres wrote: > Check this > thread:http://groups.google.com/group/jquery-dev/browse_thread/thread/664cb8... > > I've written a plugin to allow you to call methods as they should be > called on a plugin while still using 'this' to refer to the DOM > collectio

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-23 Thread tres
Check this thread: http://groups.google.com/group/jquery-dev/browse_thread/thread/664cb89b43ccb92c/34f74665423f73c9?lnk=gst&q=structure+plugin+authoring#34f74665423f73c9 I've written a plugin to allow you to call methods as they should be called on a plugin while still using 'this' to refer to th

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-23 Thread Bob Spryn
Cool. Good suggestion. Very smart. Thanks, Bob On Jun 23, 2:48 am, samer wrote: > It's not wrong, but to save you all the lines in the switch you could > implement your functions (init, advance, ...) in an object like > var jMyPlugin = { init: function() > > or > > jMyPlugin.prototype.init >

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-23 Thread samer
It's not wrong, but to save you all the lines in the switch you could implement your functions (init, advance, ...) in an object like var jMyPlugin = { init: function() or jMyPlugin.prototype.init or whatever so then your switch case could be replaced with } else if (typeof

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-22 Thread Bob Spryn
So here's what I've done and it seems to be working pretty well. Let me know if I'm doing anything weird. (I'm going to provide access to the default options object publicly at some point, but its working for now) //Simple screen wizard plugin ;(function($) { $.fn.screenWizard = function

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-22 Thread Bob Spryn
I think I would still be able to chain after the initial plugin call, but not on subsequent method calls... but I see what you are saying. Interesting. So in your first example there I would be checking if the argument was an object... and call init() if it was, otherwise examine the string and c

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-22 Thread Damir Zekić
On Jun 22, 7:10 am, Bob Spryn wrote: > Ok I actually figured it out, but I'm not sure if this is even a ok > way to be doing this. > > Basically this just initializes the plugin and gives my variable the > advance, back, and reset methods with the appropriate settings. > > var screenwizard = $("#

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-22 Thread Bob Spryn
BTW, here is the working code: //Simple screen wizard plugin ;(function($) { $.fn.screenWizard = function (options) { var self = this; var defaultOptions = { size : "100", duration : 1000,

[jquery-dev] Re: Question on writing a jQuery plugin

2009-06-21 Thread Bob Spryn
Ok I actually figured it out, but I'm not sure if this is even a ok way to be doing this. Basically this just initializes the plugin and gives my variable the advance, back, and reset methods with the appropriate settings. var screenwizard = $("#someframe").screenWizard(opts) Now I can do scree