> I wrote a new plugin which can transform an image into a button.
> You can check out the demo here:
> http://www.webunity.nl/_test/jquery/jButton/

I like the features. It would be better if the markup was a <button> and the
plugin replaced or changed that as needed. Buttons can have an ACCESSKEY
attribute for accelerator keys (When ACCESSKEY="G", the button is clicked
when you hit Alt-G) and I really like keyboard shortcuts. Using a button
also holds closer to the semantic markup meme that everyone loves nowadays.

This is an interesting design dilemma:

> this.cfgButton = { ... };

Where "this" is the jQuery object with the images to be converted to
buttons. It's actually one of the documented ways for plugins to have
options, see http://jquery.com/docs/Plugins/Authoring/ . However, if someone
were to try and chain multiple uses of iButton on the jQuery same object,
the later call would clobber cfgButton from an earlier call. Also, one of
the reasons for using an object attached to the jQuery object is to avoid a
closure. In this case the jQuery object is used inside the mouse event
handlers (aliased as _this) so the closure happens anyway. 

Some good messages have gone around about plugin design. I have wanted to
draw those together and expand the Authoring page so we would have a set of
best practices, but I have been too darned busy lately. 


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to