Forum Moderators: open
Honestly I find much of the functionality confusing as a newbie ( maybe I have finally grown a touch beyond newbie ;) )
Just something for newbies to ponder, make sure you are going to use it sufficiently to warrant the cost in size.
My favorite components of the library are the Event and Dom utilities. Makes event handling so easy. For example, you can do things like this:
YAHOO.util.Event.on(window, 'load', function() {
// All your window onload methods go here
// For example, attaching an onclick handler to a link
YAHOO.util.Event.on('someLink', 'click', function(e) {
YAHOO.util.Event.stopEvent(e);
alert('You clicked on a link to ' + this.href + ', but I'm stopping you');
});
});
There's so much that can be done with this library, including adding animations or other cool effects.
Yes, it does add weight to the page. But the library includes minified versions of the files where all of the extra whitespace and comments have been stripped out, and if you can serve them up GZIPPED, then it's even smaller. They also let you serve the files directly from the Yahoo servers if you want (so if someone has visited some other site that included those files from the Yahoo server, they will already be cached in the browser). Or you could install them locally.
Great library.