src/cm/media/js/lib/yui/yui_3.0.0b1/examples/widget/widget-build.html
author raph
Mon, 23 Nov 2009 15:14:29 +0100
changeset 0 40c8f766c9b8
permissions -rw-r--r--
import from internal svn r 4007


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>YUI Library Examples: Widget: Creating custom widget classes</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">

/* Standard Module Widget CSS */
.yui-standardmodule-hidden {
    display:none;
}

.yui-standardmodule {
    margin:10px;
}

.yui-standardmodule-content {
    padding:3px;
    border:1px solid #666;
}

.yui-standardmodule-content .yui-widget-hd {
    padding:5px;
    border:2px solid #aa0000;
    background-color:#fff;
    overflow:auto;
}

.yui-standardmodule-content .yui-widget-bd {
    padding:5px;
    border:2px solid #0000aa;
    background-color:#fff;
    overflow:auto;
}

.yui-standardmodule-content .yui-widget-ft {
    padding:5px;
    border:2px solid #00aa00;
    background-color:#fff;
    overflow:auto;
}

/* Positionable Widget CSS */
.yui-positionable {
    position:absolute;
}

.yui-positionable-content {
    text-align:center;
    border:1px solid #000;
    background-color:#999966;
    color:#fff;
    padding:10px;
}

.yui-positionable-hidden {
    visibility:hidden;
}

/* Alignable Widget CSS */
.yui-alignable {
    position:absolute;
}

.yui-alignable-content {
    text-align:center;
    border:1px solid #000000;
    background-color:#004C6D;
    color:#fff;
    padding:2px;
}

.yui-alignable-hidden {
    visibility:hidden;
}


/* Example Layout CSS */
.widget-build-example {
    border:1px solid #000;
    background-color:#eee;
    padding:5px;
    margin:10px 0;
}

.widget-build-example button, .widget-build-example label, .widget-build-example select, .widget-build-example input {
    margin-right:5px;
}

.widget-build-example button.fail {
    color:#cc0000;
    margin-left:10px;
}

.widget-build-example .filler {
    color:#999;
}

#x, #y {
    width:3em;
}

#widget2-example, #widget3-example {
    height:15em;
}

#widget2-example select, #widget3-example select {
    width:100%;
}

#alignment p {
    color:#dddd00;
}
</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 &amp; 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: Widget: Creating custom widget classes</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>Widget: Creating custom widget classes</h2>

	<div id="example" class="promo">
	<p>
	This example shows how you can mix and match the <code>WidgetPostion</code>, <code>WidgetPositionExt</code>, <code>WidgetStack</code> and <code>WidgetStdMod</code> extensions to build custom versions of the <code>Widget</code> class, using <code>Base.build</code>.
	</p>	

	<div class="module example-container ">
			<div class="hd exampleHd">
			<p class="newWindowButton yui-skin-sam">
                <a href="widget-build_clean.html" target="_blank">View example in new window.</a>
            </p>
		</div>		<div id="example-canvas" class="bd">

		
	<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
	
	
<ol>
    <li><code>Widget</code> with <code>WidgetStdMod</code>

        <div class="widget-build-example" id="widget1-example">
            <input type="text" id="content" value="">
            <select id="section">
                <option value="header">Header</option>
                <option value="body">Body</option>
                <option value="footer">Footer</option>
            </select>
            <button type="button" id="setContent">Set Content</button>
            <button type="button" class="fail" id="tryMove">move() (should fail)</button>
        
            <div id="widget1">
                <div class="yui-widget-hd">Module Header</div>
                <div class="yui-widget-bd">Module Body</div>
                <div class="yui-widget-ft">Module Footer</div>
            </div>
        
            <p class="filler">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam.</p>
        </div>
    </li>

    <li><code>Widget</code> with <code>WidgetPosition, WidgetStack</code>

        <div class="widget-build-example" id="widget2-example">
            <label>X: <input type="text" id="x" value="0" ></label>
            <label>Y: <input type="text" id="y" value="0" ></label>
            <button type="button" id="move">Move</button>
            <button type="button" class="fail" id="tryContent">setStdModContent() (should fail)</button>

            <div id="widget2"><strong>Positionable Widget</strong></div>

            <p class="filler">
                <select>
                    <option>Prevent IE6 Bleedthrough</option>
                </select>
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam. Pellentesque euismod. Nam tincidunt, purus in ultrices congue, urna neque posuere arcu, aliquam tristique purus sapien id nulla. Etiam rhoncus nulla at leo. Cras scelerisque nisl in nibh. Sed eget odio. Morbi elit elit, porta a, convallis sit amet, rhoncus non, felis. Mauris nulla pede, pretium eleifend, porttitor at, rutrum id, orci. Quisque non urna. Nulla aliquam rhoncus est. 
            </p>
        </div>
    </li>
    
    <li><code>Widget</code> with <code>WidgetPosition, WidgetStack, WidgetPositionExt</code></strong>

        <div class="widget-build-example" id="widget3-example">
            <button type="button" id="run">Run Through Alignment</button>
            <p class="filler">
                <select>
                    <option>Prevent IE6 Bleedthrough</option>
                </select>
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam. Pellentesque euismod. Nam tincidunt, purus in ultrices congue, urna neque posuere arcu, aliquam tristique purus sapien id nulla. Etiam rhoncus nulla at leo. Cras scelerisque nisl in nibh. Sed eget odio. Morbi elit elit, porta a, convallis sit amet, rhoncus non, felis. Mauris nulla pede, pretium eleifend, porttitor at, rutrum id, orci. Quisque non urna. Nulla aliquam rhoncus est.
            </p>
        </div>
    </li>
</ol>


<script type="text/javascript">
YUI({base:"../../build/", timeout: 10000}).use("widget", "widget-position", "widget-stack", "widget-position-ext", "widget-stdmod", "queue", function(Y) {



    // WIDGET 1 : Build Widget with StdMod, but no positioning/stacking support.

    var StandardModule = Y.Base.build("standardModule", Y.Widget, [Y.WidgetStdMod]);

    var stdmod = new StandardModule({
        contentBox: "#widget1",
        width:"12em",
        height:"12em"
    });
    stdmod.render();

    var contentInput = Y.Node.get("#content");
    var sectionInput = Y.Node.get("#section");

    Y.on("click", function(e) {
        var content = contentInput.get("value");
        var section = sectionInput.get("value");

        stdmod.setStdModContent(section, content);

    }, "#setContent");

    Y.on("click", function(e) {
        try {
            stdmod.move([0,0]);
        } catch (e) {
            alert("move() is " + typeof stdmod.move + ", stdmod.hasImpl(Y.WidgetPosition) : " + stdmod.hasImpl(Y.WidgetPosition));
        }
    }, "#tryMove");



    // WIDGET 2: Build Widget with Position support and Stack support, but no StdMod support or Position Extras support.

    var Positionable = Y.Base.build("positionable", Y.Widget, [Y.WidgetPosition, Y.WidgetStack]);

    var positionable = new Positionable({
        contentBox: "#widget2",
        width:"10em",
        zIndex:1
    });
    positionable.render("#widget2-example");

    var xy = Y.Node.get("#widget2-example > p").getXY();

    positionable.move(xy[0], xy[1]);

    var xInput = Y.Node.get("#x");
    var yInput = Y.Node.get("#y");

    xInput.set("value", Math.round(xy[0]));
    yInput.set("value", Math.round(xy[1]));

    Y.on("click", function(e) {
        var x = parseInt(xInput.get("value"));
        var y = parseInt(yInput.get("value"));

        positionable.move(x,y);

    }, "#move");

    Y.on("click", function(e) {
        try {
            positionable.setStdModContent("header", "new content");
        } catch (e) {
            alert("setStdModContent() is " + typeof positionable.setStdModContent + ", positionable.hasImpl(Y.WidgetStdMod) : " + positionable.hasImpl(Y.WidgetStdMod));
        }
    }, "#tryContent");



    // WIDGET 3: Build Widget with Position, PositionExt and Stack support, but no StdMod support.

    var Alignable = Y.Base.build("alignable", Y.Widget, [Y.WidgetPosition, Y.WidgetPositionExt, Y.WidgetStack]);

    var alignable = new Alignable({
        width:"13em",
        align : {
            node: "#widget3-example",
            points: ["cc", "cc"]
        },
        zIndex:1
    });
    alignable.get("contentBox").set("innerHTML", '<strong>Alignable Widget</strong><div id="alignment"><p>#widget3-example</p><p>[center, center]</p></div>');
    alignable.render("#widget3-example");

    Y.on('click', function() {
        var stepDelay = 2500;
        var currAlignment = Y.Node.get("#alignment");
        var steps = [
            function() {
                alignable.set("align", {node:"#widget3-example", points:["lc", "rc"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[left-center, right-center]</p>");
            },
            function() {
                alignable.set("align", {node:"#widget3-example", points:["tr", "br"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[top-right, bottom-right]</p>");
            },
            function() {
                alignable.set("centered", "#widget3-example");
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>centered</p>");
            },
            function() {
                alignable.set("align", {points:["rc", "rc"]});
                currAlignment.set("innerHTML", "<p>viewport</p><p>[right-center, right-center]</p>");
            },
            function() {
                alignable.set("centered", true);
                currAlignment.set("innerHTML", "<p>viewport</p><p>centered</p>");
            },
            function() {
                alignable.set("align", {node:"#widget3-example", points:["cc", "cc"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[center, center]</p>");
            }
        ];
    
        var q = new Y.AsyncQueue();
        for (var i = 0; i < steps.length; i++){
            q.add({
                timeout: (i === 0) ? 0 : stepDelay,
                fn:steps[i]
            });
        }
        q.run();
        
    }, "#run");

});
</script>
	
	<!--END SOURCE CODE FOR EXAMPLE =============================== -->
	
		
		</div>
	</div>			
	</div>
		
	<h3>Creating Custom Widget Classes</h3>

<p>The <code>Base</code> class provides a <code>build</code> method which can be used to create custom versions of classes which derive from <code>Base</code> by adding extension classes to them.</p>

<p>Widget currently ships with four such extensions: <code>WidgetPosition</code>, <code>WidgetStack</code>, <code>WidgetPositionExt</code> and <code>WidgetStdMod</code>.
These extensions are used to build the basic <code>Overlay</code> widget, but can also be used individually, to create custom versions of the base <code>Widget</code> class.</p>

<h3>Widget with WidgetStdMod support</h3>

<p>Adding the <code>WidgetStdMod</code> extension to Widget, creates a statically positioned Widget, with support for standard module format sections - header, body and footer, which maybe useful in portal type use cases, where the positioning/stacking capabilities which come bundled with Overlay are not required.</p>

<p>To create a custom class, we use <a href="../../api/Base.html#method_Base.build"><code>Base.build</code></a>, which is described in detail on the documention page for <a href="http://developer.yahoo.com/yui/3/base/#extensions">Base</a>.</p>

<p>We pass in <code>Widget</code> as the main class we want to add extensions to, and <code>WidgetStdMod</code> as the extension we'd like added to the main class:</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    var StandardModule = Y.Base.build("standardModule", Y.Widget, [Y.WidgetStdMod]);

    // Render from Markup
    var stdmod = new StandardModule({
        contentBox: "#widget1",
        width:"12em",
        height:"12em"
    });
    stdmod.render();
</textarea>

<p><code>Base.build</code> will:</p>
<ol>
    <li>Create a new class which extends <code>Widget</code></li>
    <li>Aggregate known <code>Base</code> and <code>Widget</code> fields, such as <code>ATTRS</code> and <code>HTML_PARSER</code> from <code>WidgetStdMod</code> on the new class</li>
    <li>Augment prototype methods from <code>WidgetStdMod</code> onto the new class prototype</li>
</ol>

<p>The first argument to build is the <code>NAME</code> of the new class we are creating, just like the <code>NAME</code> we define when extending the Widget class directly.</p>

<p>Note that the <code>Widget</code> class is unchanged, allowing you to still create <code>Widget</code> instances without any standard module support, along with <code>StandardModule</code> instances which have standard module support.</p>

<h4>Testing It Out</h4>

<p>The example attempts to set content on an instance of the newly created <code>StandardModule</code> class, using the <code>setStdModContent</code> method which is added by the extension (which would otherwise not exist on the Widget instance).</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    var contentInput = Y.Node.get("#content");
    var sectionInput = Y.Node.get("#section");

    // This should work, since the StandardModule widget has settable 
    // header/body/footer sections
    Y.on("click", function(e) {

        var content = contentInput.get("value");
        var section = sectionInput.get("value");

        stdmod.setStdModContent(section, content);

    }, "#setContent");
</textarea>

<p>To verify that no unrequested features are added, we also attempt to move the instance using the <code>move</code> method, which is not part of the base Widget class, and would be added by the <code>WidgetPosition</code> extension. This verifies that the other example classes we'll create, which do create new classes which use <code>WidgetPosition</code>, have not modified the base Widget class.</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    // This shoud fail, since the StandardModule widget is not positionable
    Y.on("click", function(e) {
        try {
            stdmod.move([0,0]);
        } catch (e) {
            alert("move() is " + typeof stdmod.move + ", stdmod.hasImpl(Y.WidgetPosition) : " + stdmod.hasImpl(Y.WidgetPosition));
        }
    }, "#tryMove");
</textarea>

<p>Note that <code>Base.build</code> adds a <code>hasImpl</code> method to the built class, which allows you to query whether or not it has a particular extension applied.</p>

<h4>CSS Considerations</h4>

<p>We need to define the CSS which goes with this new <code>StandardModule</code> class we have created. The only rule really required out of the box is the rule which handles visibility (<code>yui-standardmodule-hidden</code>). The "standardmodule" used in the class name comes from the <code>NAME</code> property we set up for the new class, and is used to prefix all state related classes added to the widgets bounding box.
Since the <code>StandardModule</code> class is not positionable, we use <code>display:none</code> to define the <code>hidden</code> state.</p>

<textarea name="code" class="CSS" rows="1" cols="60">

/* Visibility - How to handle visibility for this new widget */
.yui-standardmodule-hidden {
    display:none;
}
</textarea>

<p>The other "yui-standardmodule" rules are only used to create the required look/feel for this particular example, and do not impact the StandardModule widget's functionality.</p>

<h3>Widget with WidgetPosition and WidgetStack support</h3>

<p>As with <code>StandardModule</code>, we use <code>Base.build</code> to create the new <code>Positionable</code> widget class. This time we add <code>WidgetPosition</code> and <code>WidgetStack</code> support to the base <code>Widget</code> class to create a basic XY positionable widget, with shimming and z-index support.</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    var Positionable = Y.Base.build("positionable", Y.Widget, [Y.WidgetPosition, Y.WidgetStack]);

    // Render from markup
    var positionable = new Positionable({
        contentBox: "#widget2",
        width:"10em",
        height:"10em",
        zIndex:1
    });
    positionable.render("#widget2-example");

    var xy = Y.Node.get("#widget2-example > p").getXY();

    positionable.move(xy[0], xy[1]);
</textarea>

<p>We <strong>don't</strong> add <code>WidgetPositionExt</code> or <code>WidgetStdMod</code> support, so the widget doesn't have extended positioning support (align, center) or standard module support. Hence we position it manually using the <code>move</code> method which the <code>WidgetPosition</code> extension provides.</p>

<h4>Testing It Out</h4>

<p>We should now be able to invoke the <code>move</code> method on an instance of the newly created <code>Positionable</code> class:</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    // This should work, since Positionable has basic XY Positioning support
    Y.on("click", function(e) {
        var x = parseInt(xInput.get("value"));
        var y = parseInt(yInput.get("value"));

        positionable.move(x,y);

    }, "#move");
</textarea>

<p>And, as with the <code>StandardModule</code> class, we should not be allowed to invoke any methods from an extension which we didn't request:</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    // This should fail, since Positionable does not have Standard Module sections
    Y.on("click", function(e) {
        try {
            positionable.setStdModContent("header", "new content");
        } catch (e) {
            alert("setStdModContent() is " + typeof positionable.setStdModContent + ", positionable.hasImpl(Y.WidgetStdMod) : " + positionable.hasImpl(Y.WidgetStdMod));
        }
    }, "#tryContent");
</textarea>

<h4>CSS Considerations</h4>

<p>Since now we have a positionable widget, with z-index support, we set the widget to be absolutely positioned by default, and control it's hidden state using <code>visibility</code> as opposed to <code>display</code></p>

<textarea name="code" class="CSS" rows="1" cols="60">
/* Define absolute positioning as the default for positionable widgets */
.yui-positionable {
    position:absolute;
}

/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/
.yui-positionable-hidden {
    visibility:hidden;
}
</textarea>

<h3>Widget with WidgetPosition, WidgetStack and WidgetPositionExt support</h3>

<p>Lastly, we'll attempt to create a new widget class, which, in addition to basic positioning and stacking support, also has extended positioning support, allowing us to align it with other elements on the page.</p>

<p>Again, we use <code>Base.build</code> to create our new <code>Alignable</code> widget class, by combining <code>WidgetPosition</code>, <code>WidgetStack</code> and <code>WidgetPositionExt</code> with the base widget class:</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    var Alignable = Y.Base.build("alignable", Y.Widget, [Y.WidgetPosition, Y.WidgetPositionExt, Y.WidgetStack]);

    var alignable = new Alignable({
        width:"13em",
        align : {
            node: "#widget3-example",
            points: ["cc", "cc"]
        },
        zIndex:1
    });
    alignable.get("contentBox").set("innerHTML", '<strong>Alignable Widget</strong><div id="alignment"><p>#widget3-example</p><p>[center, center]</p></div>');
    alignable.render("#widget3-example");
</textarea>

<h4>Testing It Out</h4>

<p>We'll attempt to align an instance of the <code>Alignable</code> class, using some of the additional attributes which <code>WidgetPositionExt</code> adds to the base <code>Widget</code> class: <code>align</code> and <code>centered</code>:</p>

<textarea name="code" class="JScript" rows="1" cols="60">
    // Align left-center egde of widget to right-center edge of the node with id "widget3-example"
    alignable.set("align", {node:"#widget3-example", points:["lc", "rc"]});
    
    // Align top-right corner of widget to bottom-right corner of the node with id "widget3-example"
    alignable.set("align", {node:"#widget3-example", points:["tr", "br"]});

    // Center the widget in the node with id "widget3-example"
    alignable.set("centered", "widget3-example");

    // Align the right-center edge of the widget to the right center edge of the viewport (since a node is not provided to 'align')
    alignable.set("align", {points:["rc", "rc"]});

    // Center the widget in the viewport (wince a node is not provided to 'centered')
    alignable.set("centered", true);

    // Return the node to it's original alignment (centered in the node with id "widget3-example")
    // NOTE: centered is a shortcut for align : { points:["cc", "cc"] }
    alignable.set("align", {node:"#widget3-example", points:["cc", "cc"]});
</textarea>

<h4>CSS Considerations</h4>

<p>The <code>Alignable</code> widget class, has the same core CSS rules as the <code>Positionable</code> class, to define how it is positioned and how it is hidden:</p>

<textarea name="code" class="CSS" rows="1" cols="60">
/* Define absolute positioning as the default for alignable widgets */
.yui-alignable {
    position:absolute;
}

/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/
.yui-alignable-hidden {
    visibility:hidden;
}
</textarea>
				</div>
				<div class="yui-u sidebar">
					
				
					<div id="examples" class="mod box4">
                        <div class="hd">
						<h4>
    Widget Examples:</h4>
                        </div>
						<div class="bd">
							<ul>
								<li><a href='../widget/widget-extend.html'>Extending the base widget class</a></li><li class='selected'><a href='../widget/widget-build.html'>Creating custom widget classes</a></li><li><a href='../widget/widget-tooltip.html'>Creating a simple Tooltip widget</a></li>							</ul>
						</div>
					</div>
					
					<div class="mod box4">
                        <div class="hd">
						<h4>More Widget Resources:</h4>
                        </div>
                        <div class="bd">
						<ul>
							<!-- <li><a href="http://developer.yahoo.com/yui/widget/">User's Guide</a> (external)</li> -->
						<li><a href="../../api/module_widget.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="item"><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="selected "><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 &amp; Drop - Functional Examples" href="../../examples/dd/index.html">Drag &amp; 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 &copy; 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>