jQuery doesn't have built-in OO class support, but you can easily
continue to use the Prototype idiom.  You would just include the Class
def:

var Class = {
 create: function() {
   return function() {
     this.initialize.apply(this, arguments);
   }
 }
}

And then use it the way you're accustomed, making minor changes to the $ usage:

var Multi = Class.create();
Multi.prototype = {
  options: {
      max : -1
  },
  initialize: function(el, options) {
      //this.setOptions(options);
      this.fld = $(el)[0]; // <-- note change here
  },
  convert: function(v) {
      return v.replace(/\\/g,'/');
  }
};

var m = new Multi(el);


I think this would work.

Mike



On 5/1/07, mmjaeger <[EMAIL PROTECTED]> wrote:

anybody?

On Apr 27, 12:08 pm, mmjaeger <[EMAIL PROTECTED]> wrote:
> Hello
>
> I'd like to get started with jquery and I was wondering whether
> somebody could give me a little hand or point me into the right
> direction.
>
> How would I properlyconvertsomething like the following to jquery:
>
>         var Multi = new Class ({
>                 options: {
>                         max                             : -1
>                 },
>                 initialize: function(el, options) {
>                         this.setOptions(options);
>                         this.fld                = $(el);
>                 },
>                convert: function(v) {
>                         return v.replace(/\\/g,'/');
>                 }
>         });
>
> var m = new Multi(el);
>
> Thank you in advance for your help.


Reply via email to