- Element.implement({
- 'click': function(fn) {
- return this.addEvent('click',fn);
- }
- });
- Element.implement({
- 'mouseenter': function(fn) {
- return this.addEvent('mouseenter',fn);
- }
- });
- Element.implement({
- 'mouseleave': function(fn) {
- return this.addEvent('mouseleave',fn);
- }
- });
I'v been using happily David Walsh jQuery-like click syntax and "extended" it naturally to mouseleave mousenter :
http://davidwalsh.name/implement-jquery-click-syntax-mootools#comments
1st question, is it possible to make it only one function ? Like this it is a bit "gross".
Also,looks like it could be :
- Element.implement({
- 'click': function(fn) {
- this.addEvent('click',fn);
- }
- });
What do you think ?


