The Yahoo User Interface Library (YUI) is a JavaScript framework that helps build web applications by abstracting away browser inconsistencies and issues. It includes CSS solutions for layouts and typography, JavaScript utilities, and tested widgets like AutoComplete, DataTable, Button, Calendar, and more. All components are fully documented and have examples to learn from. YUI makes it easier to build interfaces without dealing with browser pain points and allows chaining of animations through custom events.
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
YUI introduction to build hack interfaces
1. The Yahoo User
Interface Library
(YUI)
Christian Heilmann | http://wait-till-i.com | http://scriptingenabled.org
Delhi, India, University Hack Day, January 2009
22. The controls are driven by
custom events to allow for
extending and monitoring
them.
23.
24. Say for example you want to
make sure to securely chain
animation sequences...
25. //This is the first animation; this one will
//fire when the button is clicked.
var move = new YAHOO.util.Anim(quot;animatorquot;, {
left: {from:0, to:75}
}, 1);
//This is the second animation; it will fire
//when the first animation is complete.
var changeColor = new YAHOO.util.ColorAnim(
quot;animatorquot;, { backgroundColor:
{from:quot;#003366quot;, to:quot;#ff0000quot;}
}, 1);
//Here's the chaining glue: We subscribe to the
//first animation's onComplete event, and in
//our handler we animate the second animation:
move.onComplete.subscribe(function() {
changeColor.animate();
});
26. //Here we set up our YUI Button and subcribe to
//its click event. When clicked, it will
//animate the first animation:
var start = new YAHOO.widget.Button(quot;startAnimquot;);
start.subscribe(quot;clickquot;, function() {
//reset the color value to the start so that
//the animation can be run multiple times:
YAHOO.util.Dom.setStyle(quot;animatorquot;,
quot;backgroundColorquot;,
quot;#003366quot;);
move.animate();
});
27. //You can also make use of the onStart and onTween
//custom events in Animation; here, we'll log all
//of changeColor's custom events and peek at their
//argument signatures:
changeColor.onStart.subscribe(function() {
YAHOO.log(quot;changeColor animation is starting.quot;,
quot;infoquot;, quot;examplequot;);
});
changeColor.onTween.subscribe(function(s, o) {
YAHOO.log(quot;changeColor onTween firing with these
arguments: quot; + YAHOO.lang.dump(o),
quot;infoquot;, quot;examplequot;);
});
changeColor.onComplete.subscribe(function(s, o) {
YAHOO.log(quot;changeColor onComplete firing with
these arguments: quot; + YAHOO.lang.dump(o),
quot;infoquot;, quot;examplequot;);
});
28. All YUI components come as a
debug version which log
everything that is going on to
the logger.
29. All in all YUI allows you to
build web interfaces without
having to know all the pain
that goes on in the browser
world.
30. Built on agreed standards
Separated into modules
each dealing with one task
Constant reporting of what
is going on
Own Debugging
environment