[jQuery] Re: Can this plugin be structured better?

2009-07-16 Thread Jules
May be something like this? (function($) { $.fn.editable = function(options) { var defaults = { // default value declarations } var opts = $.extend(defaults, options); return this.each(function() {

[jQuery] Re: Can this plugin be structured better?

2009-07-16 Thread Harvey
I did think of that solution but where would I put functions shared by myImg and myDiv that need access to the $this and tag variables?

[jQuery] Re: Can this plugin be structured better?

2009-07-16 Thread Jules
In the object init, pass this. switch (tag) { case 'DIV': obj = new $.myDiv(); obj.init ($this);break; jQuery.myDiv= function() { this.init = initDiv; this.doSomething = divFunction; this.actualObject; return this; function

[jQuery] Re: Can this plugin be structured better?

2009-07-12 Thread 刘永杰
why send twice the same email? 2009/7/12 Harvey scottandrewhar...@gmail.com Hey, I'm in the process of developing a new plugin but the way I have structured the codes doesn't seem quite right to me so I'm hoping someone might be able to offer a better way to do it. The plugin itself has