<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI Library Examples: Attribute: Getters, Setters and Validators</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../assets/yui.css" >
<style>
/*Supplemental CSS for the YUI distribution*/
#custom-doc { width: 95%; min-width: 950px; }
#pagetitle {background-image: url(../../assets/bg_hd.gif);}
/* #pagetitle h1 {background-image: url(../../assets/title_h_bg.gif);}*/
</style>
<link rel="stylesheet" type="text/css" href="../../assets/dpSyntaxHighlighter.css">
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yui/yui-min.js"></script>
<style type="text/css">
#boxParent {
overflow:hidden;
background-color:#004c6d;
height:25em;
padding:10px;
margin:5px;
}
#boxParent .yui-box p, #attrs p {
margin:2px;
}
.attrs {
border:1px solid #000;
background-color:#cdcdcd;
margin:5px;
}
.attrs .header {
font-weight:bold;
background-color:#aaa;
padding:5px;
}
.attrs .body {
padding:10px;
}
.attrs .body .hints li {
padding-bottom:10px;
}
.attrs .footer {
padding:0px 20px 10px 20px;
}
.attrs label {
font-weight:bold;
display:block;
float:left;
width:4em;
}
.attrs .hint {
font-size:85%;
color: #004c6d;
}
.attrs .fields {
border-top:1px solid #aaa;
padding:10px;
}
.yui-box {
padding:5px;
border:1px solid #000;
width:8em;
height:8em;
text-align:center;
color:#000;
}
.yui-box .color, .yui-box .coord {
font-family:courier;
}
</style>
</head>
<body id="yahoo-com" class=" yui-skin-sam">
<div id="custom-doc" class="yui-t2">
<div id="hd">
<div id="ygunav">
<p>
<em>
<a href="http://developer.yahoo.com/yui/3/">YUI 3.x Home</a> <i> - </i>
</em>
</p>
<form action="http://search.yahoo.com/search" id="sitesearchform">
<input name="vs" type="hidden" value="developer.yahoo.com">
<input name="vs" type="hidden" value="yuiblog.com">
<div id="sitesearch">
<label for="searchinput">Site Search (YDN & YUIBlog): </label>
<input type="text" id="searchinput" name="p">
<input type="submit" value="Search" id="searchsubmit" class="ygbt">
</div>
</form>
</div>
<div id="ygma"><a href="../../"><img src="../../assets/logo.gif" border="0" width="200" height="93"></a></div>
<div id="pagetitle"><h1>YUI Library Examples: Attribute: Getters, Setters and Validators</h1></div>
</div>
<div id="bd">
<div id="bar-note"><p><strong>Note:</strong> This is YUI 3.x. Looking for <a href="http://developer.yahoo.com/yui/">YUI 2.x</a>?</p></div>
<div id="yui-main">
<div class="yui-b">
<div class="yui-ge">
<div class="yui-u first example" id="main">
<h2>Attribute: Getters, Setters and Validators</h2>
<div id="example" class="promo">
<p>
The <a href="attribute-basic.html">Basic Configuration</a> example shows how we can add attributes to a host class, and set up default values for them using the attribute configuration object. This example explores how you can configure <code>setter</code>, <code>getter</code> and <code>validator</code> functions for individual attributes, which can be used to modify or normalize attribute values during get and set invocations, and prevent invalid values from being stored.
</p>
<div class="module example-container ">
<div class="hd exampleHd">
<p class="newWindowButton yui-skin-sam">
<a href="attribute-getset_clean.html" target="_blank">View example in new window.</a>
</p>
</div> <div id="example-canvas" class="bd">
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="attrs" class="attrs">
<div class="header">Enter new values and click the "Set" buttons</div>
<div class="body">
<ul class="hints">
<li>Try entering valid and invalid values for x, y; or values which attempt to position the box outside it's parent (parent box co-ordinates are displayed next to the text box).</li>
<li>Try entering rgb, hex or keyword color values [ <code>rgb(255,0,0)</code>, <code>#ff0000</code>, <code>red</code> ].</li>
</ul>
<div class="fields">
<p>
<label for="x">x:</label>
<input type="text" name="x" id="x" />
<button type="button" class="action" id="setX">Set</button>
<span id="xhint" class="hint"></span>
</p>
<p>
<label for="y">y:</label>
<input type="text" name="y" id="y" />
<button type="button" class="action" id="setY">Set</button>
<span id="yhint" class="hint"></span>
</p>
<p>
<label for="color">color:</label>
<input type="text" name="color" id="color" />
<button type="button" class="action" id="setColor">Set</button>
</p>
</div>
</div>
<div class="footer">
<button type="button" class="action" id="setXY">Set XY</button>
<button type="button" class="action" id="setAll">Set All</button>
<button type="button" class="action" id="getAll">Get All</button>
</div>
</div>
<div id="boxParent"></div>
<script type="text/javascript">
// Get a new YUI instance
YUI({base:"../../build/", timeout: 10000}).use("node", "attribute", function(Y) {
// Shortcut for Y.Lang;
var L = Y.Lang;
var boxParent = Y.Node.get("#boxParent");
// Setup a custom class with attribute support
function Box(cfg) {
this._createNode(cfg);
this.addAttrs(Y.merge(Box.ATTRIBUTES), cfg);
this._sync();
this._bind();
}
Box.BUFFER = 5;
// Create the box node
Box.prototype._createNode = function() {
this._node = Y.Node.create('<div class="yui-box"><p>Positioned Box</p><p class="coord"></p><p class="color">None</p></div>');
};
// Update rendered state to match the attribute state
Box.prototype._sync = function() {
this._syncParent();
this._syncXY();
this._syncColor();
};
Box.prototype._syncParent = function() {
this.get("parent").appendChild(this._node);
};
Box.prototype._syncXY = function() {
this._node.setXY(this.get("xy"));
this._node.query("p.coord").set("innerHTML", "[" + this.get("x") + "," + this.get("y") + "]");
};
Box.prototype._syncColor = function() {
this._node.setStyle("backgroundColor", this.get("color"));
this._node.query("p.color").set("innerHTML", this.get("color"));
};
// Bind listeners for attribute change events
Box.prototype._bind = function() {
// Reflect any changes in xy, to the rendered Node
this.after("xyChange", this._syncXY);
// Reflect any changes in color, to the rendered Node
// and output the color value received from get
this.after("colorChange", this._syncColor);
// Append the rendered node to the parent provided
this.after("parentChange", this._syncParent);
};
// Get min, max unconstrained values for X. Using Math.round to handle FF3's sub-pixel region values
Box.prototype.getXConstraints = function() {
var parentRegion = this.get("parent").get("region");
return [Math.round(parentRegion.left + Box.BUFFER), Math.round(parentRegion.right - this._node.get("offsetWidth") - Box.BUFFER)];
};
// Get min, max unconstrained values for Y. Using Math.round to handle FF3's sub-pixel region values
Box.prototype.getYConstraints = function() {
var parentRegion = this.get("parent").get("region");
return [Math.round(parentRegion.top + Box.BUFFER), Math.round(parentRegion.bottom - this._node.get("offsetHeight") - Box.BUFFER)];
};
// Constrain the x,y value provided
Box.prototype.constrain = function(val) {
// If the X value places the box outside it's parent,
// modify it's value to place the box inside it's parent.
var xConstraints = this.getXConstraints();
if (val[0] < xConstraints[0]) {
val[0] = xConstraints[0];
} else {
if (val[0] > xConstraints[1]) {
val[0] = xConstraints[1];
}
}
// If the Y value places the box outside it's parent,
// modify it's value to place the box inside it's parent.
var yConstraints = this.getYConstraints();
if (val[1] < yConstraints[0]) {
val[1] = yConstraints[0];
} else {
if (val[1] > yConstraints[1]) {
val[1] = yConstraints[1];
}
}
return val;
};
// Setup attribute configuration
Box.ATTRIBUTES = {
"parent" : {
value: null
},
"x" : {
setter: function(val, name) {
// Pass through x value to xy
this.set("xy", [parseInt(val), this.get("y")]);
},
getter: function(val, name) {
// Get x value from xy
return this.get("xy")[0];
}
},
"y" : {
setter: function(val, name) {
// Pass through y value to xy
this.set("xy", [this.get("x"), parseInt(val)]);
},
getter: function() {
// Get y value from xy
return this.get("xy")[1];
}
},
"xy" : {
// Actual stored xy co-ordinates
value: [0, 0],
setter: function(val, name) {
// Constrain XY value to the parent element.
// Returns the constrained xy value, which will
// be the final value stored.
return this.constrain(val);
},
validator: function(val, name) {
// Ensure we only store a valid data value
return (L.isArray(val) && val.length == 2 && L.isNumber(val[0]) && L.isNumber(val[1]));
}
},
"color" : {
value: "olive",
getter: function(val, name) {
// Always normalize the returned value to
// a hex color value, even if the stored
// value is a keyword, or an rgb value.
if (val) {
return Y.Color.toHex(val);
} else {
return null;
}
},
validator: function(val, name) {
// Ensure we only store rgb, hex or keyword values.
return (Y.Color.re_RGB.test(val) || Y.Color.re_hex.test(val) || Y.Color.KEYWORDS[val]);
}
}
};
Y.augment(Box, Y.Attribute);
// ------
// Create a new instance of Box
var box = new Box({
parent : boxParent
});
// Set references to form controls
var xTxt = Y.Node.get("#x");
var yTxt = Y.Node.get("#y");
var colorTxt = Y.Node.get("#color");
var xHint = Y.Node.get("#xhint");
var yHint = Y.Node.get("#yhint");
function getAll() {
xTxt.set("value", box.get("x"));
yTxt.set("value", box.get("y"));
colorTxt.set("value", box.get("color"));
}
// Bind DOM events for Form Controls
// Use event delegation for the action button clicks
Y.on("delegate", function(e) {
// Get Node target from the event object
// We already know it's a button which has an action because
// of our selector (button.action), so all we need to do is
// route it based on the id.
var id = e.currentTarget && e.currentTarget.get("id");
switch (id) {
case "setXY":
box.set("xy", [parseInt(xTxt.get("value")), parseInt(yTxt.get("value"))]);
break;
case "setX":
box.set("x", parseInt(xTxt.get("value")));
break;
case "setY":
box.set("y", parseInt(yTxt.get("value")));
break;
case "setColor":
box.set("color", L.trim(colorTxt.get("value")));
break;
case "setAll":
box.set("xy", [parseInt(xTxt.get("value")), parseInt(yTxt.get("value"))]);
box.set("color", L.trim(colorTxt.get("value")));
break;
case "getAll":
getAll();
break;
default:
break;
}
}, "#attrs", "click", "button.action");
// Bind listeners to provide min, max unconstrained value hints for x, y
// (focus/blur doesn't bubble, so bind individual listeners)
Y.on("focus", function() {
var minmax = box.getXConstraints();
xHint.set("innerHTML", "Valid values: " + minmax[0] + " to " + minmax[1]);
}, xTxt);
Y.on("focus", function() {
var minmax = box.getYConstraints();
yHint.set("innerHTML", "Valid values: " + minmax[0] + " to " + minmax[1]);
}, yTxt);
Y.on("blur", function() {
xHint.set("innerHTML", "");
}, xTxt);
Y.on("blur", function() {
yHint.set("innerHTML", "");
}, yTxt);
getAll();
});
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</div>
</div>
</div>
<h3>Getter, Setter And Validator Functions</h3>
<p>Attribute lets you configure <code>getter</code> and <code>setter</code> functions for each attribute. These functions are invoked when the user calls Attribute's <code>get</code> and <code>set</code> methods, and provide a way to modify the value returned or the value stored respectively.</p>
<p>You can also define a <code>validator</code> function for each attribute, which is used to validate the final value before it gets stored.</p>
<p>All these functions receive the value and name of the attribute being set or retrieved, as shown in the example code below. The name is not used in this example, but is provided to support use cases where you may wish to share the same function between different attributes.</p>
<h4>Creating The Box Class - The X, Y And XY Attributes</h4>
<p>In this example, we'll set up a custom <code>Box</code> class representing a positionable element, with <code>x</code>, <code>y</code> and <code>xy</code> attributes.</p>
<p>Only the <code>xy</code> attribute will actually store the page co-ordinate position of the box. The <code>x</code> and <code>y</code> attributes provide the user a convenient way to set only one of the co-ordinates.
However we don't want to store the actual values in the <code>x</code> and <code>y</code> attributes, to avoid having to constantly synchronize all three.
The <code>getter</code> and <code>setter</code> functions provide us with an easy way to achieve this. We'll define <code>getter</code> and <code>setter</code> functions for both the <code>x</code> and <code>y</code> attributes, which simply pass through to the <code>xy</code> attribute to store and retrieve values:</p>
<textarea name="code" class="JScript" cols="60" rows="1">
// Setup a custom Box class
function Box(cfg) {
...
this.addAttrs(Y.merge(Box.ATTRIBUTES), cfg);
}
// Setup Box's attribute configuration
Box.ATTRIBUTES = {
...
"x" : {
setter: function(val, name) {
// Pass through x value to xy
this.set("xy", [parseInt(val), this.get("y")]);
},
getter: function(val, name) {
// Get x value from xy
return this.get("xy")[0];
}
},
"y" : {
setter: function(val, name) {
// Pass through y value to xy
this.set("xy", [this.get("x"), parseInt(val)]);
},
getter: function(val, name) {
// Get x value from xy
return this.get("xy")[1];
}
},
"xy" : {
// Actual stored xy co-ordinates
value: [0, 0],
setter: function(val, name) {
// Constrain XY value to the parent element.
// Returns the constrained xy value, which will
// be the final value stored.
return this.constrain(val);
},
validator: function(val, name) {
// Ensure we're storing a valid data value
return (L.isArray(val) && val.length == 2 && L.isNumber(val[0]) && L.isNumber(val[1]));
}
},
...
}
</textarea>
<p>The <code>validator</code> function for <code>xy</code> ensures that only valid values finally end up being stored.</p>
<p>The <code>xy</code> attribute also has a <code>setter</code> function configured, which makes sure that the box is always constrained to it's parent element. The <code>constrain</code> method which it delegates to, takes the xy value the user is trying to set and returns a constrained value if the x or y values fall outside the parent box. The value which is returned by the <code>setter</code> is the value which is ultimately stored for the <code>xy</code> attribute:</p>
<textarea name="code" class="JScript" cols="60" rows="1">
// Get min, max unconstrained values for X. Using Math.round to handle FF3's sub-pixel region values
Box.prototype.getXConstraints = function() {
var parentRegion = this.get("parent").get("region");
return [Math.round(parentRegion.left + Box.BUFFER), Math.round(parentRegion.right - this._node.get("offsetWidth") - Box.BUFFER)];
};
// Get min, max unconstrained values for Y. Using Math.round to handle FF3's sub-pixel region values
Box.prototype.getYConstraints = function() {
var parentRegion = this.get("parent").get("region");
return [Math.round(parentRegion.top + Box.BUFFER), Math.round(parentRegion.bottom - this._node.get("offsetHeight") - Box.BUFFER)];
};
// Constrains given x,y values
Box.prototype.constrain = function(val) {
// If the X value places the box outside it's parent,
// modify it's value to place the box inside it's parent.
var xConstraints = this.getXConstraints();
if (val[0] < xConstraints[0]) {
val[0] = xConstraints[0];
} else {
if (val[0] > xConstraints[1]) {
val[0] = xConstraints[1];
}
}
// If the Y value places the box outside it's parent,
// modify it's value to place the box inside it's parent.
var yConstraints = this.getYConstraints();
if (val[1] < yConstraints[0]) {
val[1] = yConstraints[0];
} else {
if (val[1] > yConstraints[1]) {
val[1] = yConstraints[1];
}
}
return val;
};
</textarea>
<p>The <code>setter</code>, <code>getter</code> and <code>validator</code> functions are invoked with the host object as the context, so that they can refer to the host object using "<code>this</code>", as we see in the <code>setter</code> function for <code>xy</code>.</p>
<h4>The Color Attribute - Normalizing Stored Values Through Get</h4>
<p>The <code>Box</code> class also has a <code>color</code> attribute which also has a <code>getter</code> and <code>validator</code> functions defined:</p>
<textarea name="code" class="JScript" cols="60" rows="1">
...
"color" : {
value: "olive",
getter: function(val, name) {
if (val) {
return Y.Color.toHex(val);
} else {
return null;
}
},
validator: function(val, name) {
return (Y.Color.re_RGB.test(val) || Y.Color.re_hex.test(val) || Y.Color.KEYWORDS[val]);
}
}
...
</textarea>
<p>The role of the <code>getter</code> handler in this case is to normalize the actual stored value of the <code>color</code> attribute, so that users always receive the hex value, regardless of the actual value stored, which maybe a color keyword (e.g. <code>"red"</code>), an rgb value (e.g.<code>rbg(255,0,0)</code>), or a hex value (<code>#ff0000</code>). The <code>validator</code> ensures the the stored value is one of these three formats.</p>
<h4>Syncing Changes Using Attribute Change Events</h4>
<p>Another interesting aspect of this example, is it's use of attribute change events to listen for changes to the attribute values. <code>Box</code>'s <code>_bind</code> method configures a set of attribute change event listeners which monitor changes to the <code>xy</code>, <code>color</code> and <code>parent</code> attributes and update the rendered DOM for the Box in response:</p>
<textarea name="code" class="JScript" cols="60" rows="1">
// Bind listeners for attribute change events
Box.prototype._bind = function() {
// Reflect any changes in xy, to the rendered Node
this.after("xyChange", this._syncXY);
// Reflect any changes in color, to the rendered Node
// and output the color value received from get
this.after("colorChange", this._syncColor);
// Append the rendered node to the parent provided
this.after("parentChange", this._syncParent);
};
</textarea>
<p>Since only <code>xy</code> stores the final co-ordinates, we don't need to monitor the <code>x</code> and <code>y</code> attributes individually for changes.</p>
<h4>DOM Event Listeners And Delegation</h4>
<p>Although not an integral part of the example, it's worth highlighting the code which is used to setup the DOM event listeners for the form elements used by the example:</p>
<textarea name="code" class="JScript" cols="60" rows="1">
// Set references to form controls
var xTxt = Y.Node.get("#x");
var yTxt = Y.Node.get("#y");
var colorTxt = Y.Node.get("#color");
// Use event delegation for the action button clicks
Y.on("delegate", function(e) {
// Get Node target from the event object.
// We already know it's a button which has an action because
// of our selector (button.action), so all we need to do is
// route it based on the id.
var id = e.currentTarget && e.currentTarget.get("id");
switch (id) {
case "setXY":
box.set("xy", [parseInt(xTxt.get("value")), parseInt(yTxt.get("value"))]);
break;
case "setX":
box.set("x", parseInt(xTxt.get("value")));
break;
case "setY":
box.set("y", parseInt(yTxt.get("value")));
break;
case "setColor":
box.set("color", L.trim(colorTxt.get("value")));
break;
case "setAll":
box.set("xy", [parseInt(xTxt.get("value")), parseInt(yTxt.get("value"))]);
box.set("color", L.trim(colorTxt.get("value")));
break;
case "getAll":
getAll();
break;
default:
break;
}
}, "#attrs", "click", "button.action");
</textarea>
<p>Rather than attach individual listeners to each button, the above code uses YUI 3's <code>delegate</code> support, to listen for clicks from <code>buttons</code> with an <code>action</code> class which bubble up to the <code>attrs</code> element.</p>
<p>The delegate listener uses the <a href="../../api/DOMEventFacade.html">Event Facade</a> which normalizes cross-browser access to DOM event properties, such as <code>currentTarget</code>, to route to the appropriate button handler. Note the use of selector syntax when we specify the elements for the listener (e.g. <code>#attrs</code>, <code>button.actions</code>) and the use of the <a href="../../api/Node.html">Node</a> facade when dealing with references to HTML elements (e.g. <code>xTxt, yTxt, colorTxt</code>).</p>
</div>
<div class="yui-u sidebar">
<div id="examples" class="mod box4">
<div class="hd">
<h4>
Attribute Examples:</h4>
</div>
<div class="bd">
<ul>
<li><a href='../attribute/attribute-basic.html'>Basic Configuration</a></li><li><a href='../attribute/attribute-event.html'>Change Events</a></li><li class='selected'><a href='../attribute/attribute-getset.html'>Getters, Setters and Validators</a></li><li><a href='../attribute/attribute-rw.html'>readOnly and writeOnce Configuration</a></li> </ul>
</div>
</div>
<div class="mod box4">
<div class="hd">
<h4>More Attribute Resources:</h4>
</div>
<div class="bd">
<ul>
<!-- <li><a href="http://developer.yahoo.com/yui/attribute/">User's Guide</a> (external)</li> -->
<li><a href="../../api/module_attribute.html">API Documentation</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="yui-b toc3" id="tocWrapper">
<!-- TABLE OF CONTENTS -->
<div id="toc">
<ul>
<li class="sect first">YUI 3.x Project</li><li class="item"><a title="The Yahoo! User Interface (YUI) Library, 3.x Branch, " href="http://developer.yahoo.com/yui/3/">YUI 3 Web Site (external)</a></li><li class="item"><a title="Examples of every YUI utility and control in action" href="../../examples/">YUI 3 Examples</a></li><li class="item"><a title="Instantly searchable API documentation for the entire YUI library." href="../../api/">YUI 3 API Docs</a></li><li class="item"><a title="The YUI Library can be downloaded from SourceForge" href="http://sourceforge.net/projects/yui/">YUI 3 on Sourceforge (external)</a></li><li class="item"><a title="YUI is free and open, offered under a BSD license." href="http://developer.yahoo.com/yui/3/license.html">YUI License (external)</a></li><li class="sect">YUI 3 Core - Examples</li><li class="item"><a title="YUI (Global Prerequisite) - Functional Examples" href="../../examples/yui/index.html">YUI (Global Prerequisite)</a></li><li class="item"><a title="Event - Functional Examples" href="../../examples/event/index.html">Event</a></li><li class="item"><a title="Node - Functional Examples" href="../../examples/node/index.html">Node</a></li><li class="sect">YUI 3 Component Infrastructure - Examples</li><li class="selected "><a title="Attribute - Functional Examples" href="../../examples/attribute/index.html">Attribute</a></li><li class="item"><a title="Plugin - Functional Examples" href="../../examples/plugin/index.html">Plugin</a></li><li class="item"><a title="Widget - Functional Examples" href="../../examples/widget/index.html">Widget</a></li><li class="sect">YUI 3 Utilities - Examples</li><li class="item"><a title="Animation - Functional Examples" href="../../examples/anim/index.html">Animation</a></li><li class="item"><a title="Cache - Functional Examples" href="../../examples/cache/index.html">Cache</a></li><li class="item"><a title="Cookie - Functional Examples" href="../../examples/cookie/index.html">Cookie</a></li><li class="item"><a title="DataSchema - Functional Examples" href="../../examples/dataschema/index.html">DataSchema</a></li><li class="item"><a title="DataSource - Functional Examples" href="../../examples/datasource/index.html">DataSource</a></li><li class="item"><a title="DataType - Functional Examples" href="../../examples/datatype/index.html">DataType</a></li><li class="item"><a title="Drag & Drop - Functional Examples" href="../../examples/dd/index.html">Drag & Drop</a></li><li class="item"><a title="Get - Functional Examples" href="../../examples/get/index.html">Get</a></li><li class="item"><a title="History - Functional Examples" href="../../examples/history/index.html">History</a></li><li class="item"><a title="ImageLoader - Functional Examples" href="../../examples/imageloader/index.html">ImageLoader</a></li><li class="item"><a title="IO - Functional Examples" href="../../examples/io/index.html">IO</a></li><li class="item"><a title="JSON (JavaScript Object Notation) - Functional Examples" href="../../examples/json/index.html">JSON</a></li><li class="item"><a title="Queue - Functional Examples" href="../../examples/queue/index.html">Queue</a></li><li class="item"><a title="Stylesheet - Functional Examples" href="../../examples/stylesheet/index.html">Stylesheet</a></li><li class="sect">YUI 3 Widgets - Examples</li><li class="item"><a title="Overlay - Functional Examples" href="../../examples/overlay/index.html">Overlay</a></li><li class="item"><a title="Slider - Functional Examples" href="../../examples/slider/index.html">Slider</a></li><li class="sect">YUI 3 Node Plugins - Examples</li><li class="item"><a title="FocusManager Node Plugin - Functional Examples" href="../../examples/node-focusmanager/index.html">FocusManager Node Plugin</a></li><li class="item"><a title="MenuNav Node Plugin - Functional Examples" href="../../examples/node-menunav/index.html">MenuNav Node Plugin</a></li><li class="sect">YUI 3 CSS - Examples</li><li class="item"><a title="YUI CSS Reset - Functional Examples" href="../../examples/cssreset/index.html">CSS Reset</a></li><li class="item"><a title="YUI Fonts - Functional Examples" href="../../examples/cssfonts/index.html">CSS Fonts</a></li><li class="item"><a title="YUI Base - Functional Examples" href="../../examples/cssbase/index.html">CSS Base</a></li><li class="sect">YUI 3 Developer Tools - Examples</li><li class="item"><a title="Console - Functional Examples" href="../../examples/console/index.html">Console</a></li><li class="item"><a title="Profiler - Functional Examples" href="../../examples/profiler/index.html">Profiler</a></li><li class="item"><a title="Test - Functional Examples" href="../../examples/test/index.html">Test</a></li><li class="sect">The YUI Community</li><li class="item"><a title="The Yahoo! User Interface Blog" href="http://yuiblog.com">YUI Blog (external)</a></li><li class="item"><a title="The Yahoo! Group YDN-JavaScript hosts the YUI community forum" href="http://tech.groups.yahoo.com/group/ydn-javascript/">YUI Forum (external)</a></li><li class="item"><a title="The Yahoo! Group yui3 is dedicated to the 3.x branch of the Yahoo! User Interface (YUI) Library." href="http://tech.groups.yahoo.com/group/yui3/">YUI 3 Forum (external)</a></li><li class="item"><a title="YUI is used by Yahoo! and by hundreds of other sites, including many you know and love." href="/yui/poweredby/">YUI Sightings (external)</a></li><li class="item"><a title="Videos and podcasts from the YUI Team and from the Yahoo! frontend engineering community." href="http://developer.yahoo.com/yui/theater/">YUI Theater (external)</a></li><li class="sect">YUI Articles on the YUI Website</li><li class="item"><a title="Answers to Frequently Asked Questions about the YUI Library" href="http://developer.yahoo.com/yui/articles/faq/">YUI FAQ (external)</a></li><li class="item"><a title="Yahoo!'s philosophy of Graded Browser Support" href="http://developer.yahoo.com/yui/articles/gbs/">Graded Browser Support (external)</a></li><li class="item"><a title="Reporting Bugs and Making Feature Requests for YUI Components" href="http://developer.yahoo.com/yui/articles/reportingbugs/">Bug Reports/Feature Requests (external)</a></li><li class="item"><a title="Serve YUI source files from Yahoo! -- free, fast, and simple" href="http://developer.yahoo.com/yui/3/articles/hosting/">Serving YUI Files from Yahoo! (external)</a></li></ul>
</div>
</div>
</div><!--closes bd-->
<div id="ft">
<p class="first">Copyright © 2009 Yahoo! Inc. All rights reserved.</p>
<p><a href="http://privacy.yahoo.com/privacy/us/devel/index.html">Privacy Policy</a> -
<a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> -
<a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright Policy</a> -
<a href="http://careers.yahoo.com/">Job Openings</a></p>
</div>
</div>
<script src="../../assets/dpSyntaxHighlighter.js"></script>
<script language="javascript">
dp.SyntaxHighlighter.HighlightAll('code');
</script>
</body>
</html>