Extend Existing Widget?

Extend Existing Widget?


Is it possible to extend an existing widget? I'd like to extend
accordion and add a couple features that don't exist in the current.
Or is the only way to copy the accordion code and modify it from
there? I was trying to do something like below with no success. Thanks
$.widget("ui.accordionCustom", $.extend({}, $.ui.accordion, { ... new
code here ... }));