Search code examples
javascriptyui3

yui3 create sugar method


How do I add sugar methods in yui3, so I can do something like this:

Y.one('#my_div').do_something();

where .do_something() is the sugar method I created. I'd like to be able to package all of my code up, so I can load it like a widget.

Basically I want to recreate jQuery's slideToggle()

Thanks for the help.


Solution

  • I figured it out and created some for everyone to use: here