/ Published in: JavaScript
URL: http://davidwalsh.name/element-collection-manipulation-shortcut-using-mootools
Expand |
Embed | Plain Text
// MooTools Looping Example (Bad/Long) $$('.toggler').each(function(el) { el.addEvent('mouseenter',function(e) { el.fireEvent('click'); }); }); // MooTools Collection Example (Good/Short) $$('.toggler').addEvent('mouseenter', function() { this.fireEvent('click'); });
You need to login to post a comment.
