3

I'm looking to see if it's possible to add methods or interactions to the jQuery UI library without editing the code itself? I want to be able to quickly upgrade as new versions come out, but still be able to add my own features that extend the base UI script.

Example:

I want to use the .dialog() method to have pointer tips to provide messaging to specific areas.

Is there an easy way to add this, or will I end up having to download the source and do it myself each time a release comes out?

Seth
  • 6,240
  • 3
  • 28
  • 44

1 Answers1

3

Access the UI widget's prototype:

var proto = $.ui.autocomplete.prototype;

proto.myNewMethodForAutocomplete = function(){
    // ...
};

You can also directy extend the prototype like this: How to extend a jquery ui widget ? (1.7)

Community
  • 1
  • 1
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134