/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// 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'); });
URL: http://davidwalsh.name/element-collection-manipulation-shortcut-using-mootools