|
0
|
1 |
|
|
|
2 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
|
3 |
<html> |
|
|
4 |
<head> |
|
|
5 |
<title>YUI Library Examples: MenuNav Node Plugin: Adding Submenus On The Fly</title> |
|
|
6 |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|
|
7 |
<link rel="stylesheet" type="text/css" href="../../assets/yui.css" > |
|
|
8 |
|
|
|
9 |
<style> |
|
|
10 |
/*Supplemental CSS for the YUI distribution*/ |
|
|
11 |
#custom-doc { width: 95%; min-width: 950px; } |
|
|
12 |
#pagetitle {background-image: url(../../assets/bg_hd.gif);} |
|
|
13 |
/* #pagetitle h1 {background-image: url(../../assets/title_h_bg.gif);}*/ |
|
|
14 |
</style> |
|
|
15 |
|
|
|
16 |
<link rel="stylesheet" type="text/css" href="../../assets/dpSyntaxHighlighter.css"> |
|
|
17 |
|
|
|
18 |
<!--there is no custom header content for this example--> |
|
|
19 |
|
|
|
20 |
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" /> |
|
|
21 |
<script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
|
|
22 |
|
|
|
23 |
</head> |
|
|
24 |
<body id="yahoo-com" class=" yui-skin-sam"> |
|
|
25 |
<div id="custom-doc" class="yui-t2"> |
|
|
26 |
<div id="hd"> |
|
|
27 |
<div id="ygunav"> |
|
|
28 |
<p> |
|
|
29 |
<em> |
|
|
30 |
<a href="http://developer.yahoo.com/yui/3/">YUI 3.x Home</a> <i> - </i> |
|
|
31 |
</em> |
|
|
32 |
</p> |
|
|
33 |
<form action="http://search.yahoo.com/search" id="sitesearchform"> |
|
|
34 |
<input name="vs" type="hidden" value="developer.yahoo.com"> |
|
|
35 |
<input name="vs" type="hidden" value="yuiblog.com"> |
|
|
36 |
<div id="sitesearch"> |
|
|
37 |
<label for="searchinput">Site Search (YDN & YUIBlog): </label> |
|
|
38 |
<input type="text" id="searchinput" name="p"> |
|
|
39 |
<input type="submit" value="Search" id="searchsubmit" class="ygbt"> |
|
|
40 |
</div> |
|
|
41 |
</form> |
|
|
42 |
</div> |
|
|
43 |
<div id="ygma"><a href="../../"><img src="../../assets/logo.gif" border="0" width="200" height="93"></a></div> |
|
|
44 |
<div id="pagetitle"><h1>YUI Library Examples: MenuNav Node Plugin: Adding Submenus On The Fly</h1></div> |
|
|
45 |
</div> |
|
|
46 |
<div id="bd"> |
|
|
47 |
|
|
|
48 |
<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> |
|
|
49 |
|
|
|
50 |
<div id="yui-main"> |
|
|
51 |
<div class="yui-b"> |
|
|
52 |
<div class="yui-ge"> |
|
|
53 |
<div class="yui-u first example" id="main"> |
|
|
54 |
|
|
|
55 |
<h2>MenuNav Node Plugin: Adding Submenus On The Fly</h2> |
|
|
56 |
|
|
|
57 |
<div id="example" class="promo"> |
|
|
58 |
<p> |
|
|
59 |
<p> |
|
|
60 |
This example demonstrates how to use the <a href="../../io/">IO Utility</a> to |
|
|
61 |
add submenus to a menu built using the MenuNav Node Plugin. |
|
|
62 |
</p> |
|
|
63 |
|
|
|
64 |
</p> |
|
|
65 |
|
|
|
66 |
<div class="module example-container newWindow"> |
|
|
67 |
<div id="example-canvas" class="bd"> |
|
|
68 |
|
|
|
69 |
<p class="newWindowButton yui-skin-sam"> |
|
|
70 |
<span id="newWindowLink"> |
|
|
71 |
<span class="first-child"> |
|
|
72 |
<a href="node-menunav-8_source.html" target="_blank">View example in new window.</a> |
|
|
73 |
</span> |
|
|
74 |
</span> |
|
|
75 |
</p> |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
</div> |
|
|
79 |
</div> |
|
|
80 |
</div> |
|
|
81 |
|
|
|
82 |
<h3>Design Goal</h3> |
|
|
83 |
<p> |
|
|
84 |
This menu will be created using the |
|
|
85 |
<a href="http://en.wikipedia.org/wiki/Progressive_enhancement">Progressive Enhancement</a> design |
|
|
86 |
pattern, so that the accessibility of the menu can be tailored based on the capabilities of |
|
|
87 |
the user's browser. The goal is to design a menu that satisfies each of the following use cases: |
|
|
88 |
</p> |
|
|
89 |
|
|
|
90 |
<table class="yui-table"> |
|
|
91 |
<thead> |
|
|
92 |
<tr> |
|
|
93 |
<th><a href="http://developer.yahoo.com/yui/articles/gbs/">Browser Grade</a></th> |
|
|
94 |
<th>Technologies</th> |
|
|
95 |
<th>User Experience</th> |
|
|
96 |
</tr> |
|
|
97 |
</thead> |
|
|
98 |
<tbody> |
|
|
99 |
<tr> |
|
|
100 |
<td>C</td> |
|
|
101 |
<td>HTML</td> |
|
|
102 |
<td>The user is using a browser for which CSS and JavaScript are being withheld.</td> |
|
|
103 |
</tr> |
|
|
104 |
<tr> |
|
|
105 |
<td>A</td> |
|
|
106 |
<td>HTML + CSS</td> |
|
|
107 |
<td>The user is using an A-Grade browser, but has chosen to disable JavaScript.</td> |
|
|
108 |
</tr> |
|
|
109 |
<tr> |
|
|
110 |
<td>A</td> |
|
|
111 |
<td>HTML + CSS + JavaScript</td> |
|
|
112 |
<td>The user is using an A-Grade browser with CSS and JavaScript enabled.</td> |
|
|
113 |
</tr> |
|
|
114 |
<tr> |
|
|
115 |
<td>A</td> |
|
|
116 |
<td>HTML + CSS + JavaScript + ARIA</td> |
|
|
117 |
<td> |
|
|
118 |
The user is using an ARIA-capable, A-Grade browser with CSS and |
|
|
119 |
JavaScript enabled. |
|
|
120 |
</td> |
|
|
121 |
</tr> |
|
|
122 |
</tbody> |
|
|
123 |
</table> |
|
|
124 |
|
|
|
125 |
<p> |
|
|
126 |
The MenuNav Node Plugin helps support most of the these use cases out of the box. By using an |
|
|
127 |
established, semantic, list-based pattern for markup, the core, C-grade experience is easily |
|
|
128 |
cemented using the MenuNav Node Plugin. Using JavaScript, the MenuNav Node Plugin implements |
|
|
129 |
established mouse and keyboard interaction patterns to deliver a user experience that is both |
|
|
130 |
familiar and easy to use, as well as support for the |
|
|
131 |
<a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA Roles and States</a>, making it easy to satisfy |
|
|
132 |
the last two use cases. The second is the only use case that <em>is not</em> handled out of the box |
|
|
133 |
when using the MenuNav Node Plugin. |
|
|
134 |
</p> |
|
|
135 |
|
|
|
136 |
<p> |
|
|
137 |
One common solution to making a menuing system work when CSS is enabled, but JavaScript is |
|
|
138 |
disabled is to leverage the <code>:hover</code> and <code>:focus</code> pseudo classes to provide |
|
|
139 |
support for both the mouse and the keyboard. However, there are a couple of problems with this |
|
|
140 |
approach: |
|
|
141 |
</p> |
|
|
142 |
|
|
|
143 |
<dl> |
|
|
144 |
<dt>Inconsistent Browser Support</dt> |
|
|
145 |
<dd> |
|
|
146 |
IE 6 only supports the <code>:hover</code> and <code>:focus</code> pseudo classes on |
|
|
147 |
<code><a></code> elements. And while IE 7 supports <code>:hover</code> on all |
|
|
148 |
elements, it only supports <code>:focus</code> pseudo class on <code><a></code> |
|
|
149 |
elements. This solution won't work if the goal is to provide a consistent user |
|
|
150 |
experience across all of the |
|
|
151 |
<a href="http://developer.yahoo.com/yui/articles/gbs/#a-grade">A-grade browsers</a> when |
|
|
152 |
JavaScript is disabled. |
|
|
153 |
</dd> |
|
|
154 |
<dt>Poor User Experience</dt> |
|
|
155 |
<dd> |
|
|
156 |
Even if the <code>:hover</code> and <code>:focus</code> pseudo classes were supported |
|
|
157 |
consistently across all |
|
|
158 |
<a href="http://developer.yahoo.com/yui/articles/gbs/#a-grade">A-grade browsers</a>, it |
|
|
159 |
would be a solution that would work, <em>but wouldn't work well</em>. Use of |
|
|
160 |
the <code>:focus</code> pseudo class to enable keyboard support for a menu results in an |
|
|
161 |
unfamiliar, potentially cumbersome experience for keyboard users. Having a menu |
|
|
162 |
appear in response to its label simply being focused isn't an established interaction |
|
|
163 |
pattern for menus on the desktop, and implementing that pattern could result in menus that |
|
|
164 |
popup unexpectedly, and as a result, have the potential to get in the user's way. While use of the |
|
|
165 |
<code>:hover</code> pseudo class can be used to show submenus in response to a |
|
|
166 |
<code>mouseover</code> event, it doesn't allow the user to move diagonally from a label to |
|
|
167 |
its corresponding submenu — an established interaction pattern that greatly improves a |
|
|
168 |
menu's usability. |
|
|
169 |
</dd> |
|
|
170 |
<dt>Bloats Code</dt> |
|
|
171 |
<dd> |
|
|
172 |
Relying on <code>:hover</code> and <code>:focus</code> as an intermediate solution when |
|
|
173 |
JavaScript is disabled adds bloat to a menu's CSS. And relying on these pseudo classes |
|
|
174 |
would also likely mean additional code on the server to detect IE, so that submenu HTML |
|
|
175 |
that is inaccessible to IE users with JavaScript disabled is not delivered to the browser. |
|
|
176 |
</dd> |
|
|
177 |
</dl> |
|
|
178 |
|
|
|
179 |
<p> |
|
|
180 |
As the functionality for displaying submenus cannot be implemented in CSS to work |
|
|
181 |
consistently and well in all |
|
|
182 |
<a href="http://developer.yahoo.com/yui/articles/gbs/#a-grade">A-grade browsers</a>, then that |
|
|
183 |
functionality is better implemented using JavaScript. And if submenus are only accessible if |
|
|
184 |
JavaScript is enabled, then it is best to only add the HTML for submenus via JavaScript. Adding |
|
|
185 |
submenus via JavaScript has the additional advantage of speeding up the initial load time of |
|
|
186 |
a page. |
|
|
187 |
</p> |
|
|
188 |
|
|
|
189 |
<h3>Approach</h3> |
|
|
190 |
|
|
|
191 |
<p> |
|
|
192 |
The approach for this menu will be to create horizontal top navigation that, when JavaScript is |
|
|
193 |
enabled, is enhanced into split buttons. The content of each submenu is functionality that is |
|
|
194 |
accessible via the page linked from the anchor of each submenu's label. Each submenu is purely |
|
|
195 |
sugar — a faster means of accessing functionality that is accessible via another path. |
|
|
196 |
</p> |
|
|
197 |
|
|
|
198 |
<h3>Setting Up the HTML</h3> |
|
|
199 |
|
|
|
200 |
<p> |
|
|
201 |
Start by providing the markup for the root horizontal menu, following the pattern outlined in the |
|
|
202 |
<a href="node-menunav-4.html">Split Button Top Nav</a> example, minus the application of the |
|
|
203 |
<code>yui-splitbuttonnav</code> class to the menu's bounding box, the markup for the submenus, |
|
|
204 |
and the <code><a href="…" class="yui-menu-toggle"></code> elements inside each label |
|
|
205 |
that toggle each submenu's display. Include the MenuNav Node Plugin CSS in the |
|
|
206 |
<code><head></code> so that menu is styled even if JS is disabled. The following |
|
|
207 |
illustrates what the initial menu markup: |
|
|
208 |
</p> |
|
|
209 |
|
|
|
210 |
<textarea name="code" class="HTML" cols="60" rows="1"> |
|
|
211 |
<div id="productsandservices" class="yui-menu yui-menu-horizontal"> |
|
|
212 |
<div class="yui-menu-content"> |
|
|
213 |
<ul> |
|
|
214 |
<li> |
|
|
215 |
<span id="answers-label" class="yui-menu-label"> |
|
|
216 |
<a href="http://answers.yahoo.com">Answers</a> |
|
|
217 |
</span> |
|
|
218 |
</li> |
|
|
219 |
<li> |
|
|
220 |
<span id="flickr-label" class="yui-menu-label"> |
|
|
221 |
<a href="http://www.flickr.com">Flickr</a> |
|
|
222 |
</span> |
|
|
223 |
</li> |
|
|
224 |
<li> |
|
|
225 |
<span id="jumpcut-label" class="yui-menu-label"> |
|
|
226 |
<a href="http://www.jumpcut.com/">Jumpcut</a> |
|
|
227 |
</span> |
|
|
228 |
</li> |
|
|
229 |
<li> |
|
|
230 |
<span id="mobile-label" class="yui-menu-label"> |
|
|
231 |
<a href="http://mobile.yahoo.com">Mobile</a> |
|
|
232 |
</span> |
|
|
233 |
</li> |
|
|
234 |
<li> |
|
|
235 |
<span id="upcoming-label" class="yui-menu-label"> |
|
|
236 |
<a href="http://upcoming.yahoo.com/">Upcoming</a> |
|
|
237 |
</span> |
|
|
238 |
</li> |
|
|
239 |
<li> |
|
|
240 |
<span id="forgood-label" class="yui-menu-label"> |
|
|
241 |
<a href="http://forgood.yahoo.com/index.html">Yahoo! for Good</a> |
|
|
242 |
</span> |
|
|
243 |
</li> |
|
|
244 |
</ul> |
|
|
245 |
</div> |
|
|
246 |
</div> |
|
|
247 |
</textarea> |
|
|
248 |
|
|
|
249 |
<h3>Setting Up the script</h3> |
|
|
250 |
<p> |
|
|
251 |
With the core markup for the menu in place, JavaScript will be responsible for transforming the |
|
|
252 |
simple horizontal menu into top navigation rendered like split buttons. The script will |
|
|
253 |
appended a submenu toggle to each menu label as well as add the <code>yui-splitbuttonnav</code> |
|
|
254 |
class to the menu's bounding box. Each submenu's label will be responsible for creating its |
|
|
255 |
corresponding submenu the first time its display is requested by the user. The content of each |
|
|
256 |
submenu is fetched asynchronously using <code>Y.io</code>. |
|
|
257 |
</p> |
|
|
258 |
|
|
|
259 |
<textarea name="code" class="JScript" cols="60" rows="1"> |
|
|
260 |
// Call the "use" method, passing in "node-menunav". This will load the |
|
|
261 |
// script and CSS for the MenuNav Node Plugin and all of the required |
|
|
262 |
// dependencies. |
|
|
263 |
|
|
|
264 |
YUI().use("node-menunav", "io", function(Y) { |
|
|
265 |
|
|
|
266 |
var applyARIA = function (menu) { |
|
|
267 |
|
|
|
268 |
var oMenuLabel, |
|
|
269 |
oMenuToggle, |
|
|
270 |
sID; |
|
|
271 |
|
|
|
272 |
menu.set("role", "menu"); |
|
|
273 |
|
|
|
274 |
oMenuLabel = menu.previous(); |
|
|
275 |
oMenuToggle = oMenuLabel.query(".yui-menu-toggle"); |
|
|
276 |
|
|
|
277 |
if (oMenuToggle) { |
|
|
278 |
oMenuLabel = oMenuToggle; |
|
|
279 |
} |
|
|
280 |
|
|
|
281 |
sID = Y.stamp(oMenuLabel); |
|
|
282 |
|
|
|
283 |
if (!oMenuLabel.get("id")) { |
|
|
284 |
oMenuLabel.set("id", sID); |
|
|
285 |
} |
|
|
286 |
|
|
|
287 |
menu.set("aria-labelledby", sID); |
|
|
288 |
|
|
|
289 |
menu.queryAll("ul,li,.yui-menu-content").set("role", "presentation"); |
|
|
290 |
|
|
|
291 |
menu.queryAll(".yui-menuitem-content").set("role", "menuitem"); |
|
|
292 |
|
|
|
293 |
}; |
|
|
294 |
|
|
|
295 |
|
|
|
296 |
var onIOComplete = function (transactionID, response, submenuNode) { |
|
|
297 |
|
|
|
298 |
var sHTML = response.responseText; |
|
|
299 |
|
|
|
300 |
submenuNode.query(".yui-menu-content").set("innerHTML", sHTML); |
|
|
301 |
submenuNode.query("ul").addClass("first-of-type"); |
|
|
302 |
|
|
|
303 |
applyARIA(submenuNode); |
|
|
304 |
|
|
|
305 |
// Need to set the width of the submenu to "" to clear it, then to nothing |
|
|
306 |
// (or the offsetWidth for IE < 8) so that the width of the submenu is |
|
|
307 |
// rendered correctly, otherwise the width will be rendered at the width |
|
|
308 |
// before the new content for the submenu was loaded. |
|
|
309 |
|
|
|
310 |
submenuNode.setStyle("width", ""); |
|
|
311 |
|
|
|
312 |
if (Y.UA.ie && Y.UA.ie < 8) { |
|
|
313 |
submenuNode.setStyle("width", (submenuNode.get("offsetWidth") + "px")); |
|
|
314 |
} |
|
|
315 |
|
|
|
316 |
|
|
|
317 |
var oAnchor = submenuNode.query("a"); |
|
|
318 |
|
|
|
319 |
if (oAnchor) { |
|
|
320 |
oAnchor.focus(); |
|
|
321 |
} |
|
|
322 |
|
|
|
323 |
}; |
|
|
324 |
|
|
|
325 |
|
|
|
326 |
var addSubmenu = function (event, submenuIdBase) { |
|
|
327 |
|
|
|
328 |
var oSubmenuNode, |
|
|
329 |
sSubmenuId = submenuIdBase + "-options", |
|
|
330 |
bIsKeyDown = (event.type === "keydown"), |
|
|
331 |
nKeyCode = event.keyCode, |
|
|
332 |
sURI; |
|
|
333 |
|
|
|
334 |
|
|
|
335 |
if ((bIsKeyDown && nKeyCode === 40) || |
|
|
336 |
(event.target.hasClass("yui-menu-toggle") && |
|
|
337 |
(event.type === "mousedown" || (bIsKeyDown && nKeyCode === 13)))) { |
|
|
338 |
|
|
|
339 |
// Build the bounding box and content box for the submenu and fill |
|
|
340 |
// the content box with a "Loading..." message so that the user |
|
|
341 |
// knows the submenu's content is in the process of loading. |
|
|
342 |
|
|
|
343 |
oSubmenuNode = Y.Node.create('<div id="' + sSubmenuId + '" class="yui-menu yui-menu-hidden"><div class="yui-menu-content"><p>Loading…</p></div></div>'); |
|
|
344 |
|
|
|
345 |
this.get("parentNode").appendChild(oSubmenuNode); |
|
|
346 |
|
|
|
347 |
|
|
|
348 |
// Use Y.io to fetch the content of the submenu |
|
|
349 |
|
|
|
350 |
sURI = "assets/submenus.php?menu=" + sSubmenuId; |
|
|
351 |
|
|
|
352 |
Y.io(sURI, { on: { complete: onIOComplete }, arguments: oSubmenuNode }); |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
// Detach event listeners so that this code runs only once |
|
|
356 |
|
|
|
357 |
this.detach("mousedown", addSubmenu); |
|
|
358 |
this.detach("keydown", addSubmenu); |
|
|
359 |
|
|
|
360 |
} |
|
|
361 |
|
|
|
362 |
}; |
|
|
363 |
|
|
|
364 |
|
|
|
365 |
// Retrieve the Node instance representing the root menu |
|
|
366 |
// (<div id="productsandservices">) |
|
|
367 |
|
|
|
368 |
var menu = Y.Node.get("#productsandservices"); |
|
|
369 |
|
|
|
370 |
menu.addClass("yui-splitbuttonnav"); |
|
|
371 |
|
|
|
372 |
|
|
|
373 |
var oSubmenuToggles = { |
|
|
374 |
answers: { label: "Answers Options", url: "#answers-options" }, |
|
|
375 |
flickr: { label: "Flickr Options", url: "#flickr-options" }, |
|
|
376 |
jumpcut: { label: "Jumpcut Options", url: "#jumpcut-options" }, |
|
|
377 |
mobile: { label: "Mobile Options", url: "#mobile-options" }, |
|
|
378 |
upcoming: { label: "Upcoming Options", url: "#upcoming-options" }, |
|
|
379 |
forgood: { label: "Yahoo! for Good Options", url: "#forgood-options" } |
|
|
380 |
}, |
|
|
381 |
|
|
|
382 |
sKey, |
|
|
383 |
oToggleData, |
|
|
384 |
oSubmenuToggle; |
|
|
385 |
|
|
|
386 |
|
|
|
387 |
// Add the menu toggle to each menu label |
|
|
388 |
|
|
|
389 |
menu.queryAll(".yui-menu-label").each(function(node) { |
|
|
390 |
|
|
|
391 |
sKey = node.get("id").split("-")[0]; |
|
|
392 |
|
|
|
393 |
oToggleData = oSubmenuToggles[sKey]; |
|
|
394 |
|
|
|
395 |
oSubmenuToggle = Y.Node.create('<a class="yui-menu-toggle">' + oToggleData.label + '</a>'); |
|
|
396 |
|
|
|
397 |
// Need to set the "href" attribute via the "set" method as opposed to |
|
|
398 |
// including it in the string passed to "Y.Node.create" to work around a |
|
|
399 |
// bug in IE. The MenuNav Node Plugin code examines the "href" attribute |
|
|
400 |
// of all <A>s in a menu. To do this, the MenuNav Node Plugin retrieves |
|
|
401 |
// the value of the "href" attribute by passing "2" as a second argument |
|
|
402 |
// to the "getAttribute" method. This is necessary for IE in order to get |
|
|
403 |
// the value of the "href" attribute exactly as it was set in script or in |
|
|
404 |
// the source document, as opposed to a fully qualified path. (See |
|
|
405 |
// http://msdn.microsoft.com/en-gb/library/ms536429(VS.85).aspx for |
|
|
406 |
// more info.) However, when the "href" attribute is set inline via the |
|
|
407 |
// string passed to "Y.Node.create", calls to "getAttribute('href', 2)" |
|
|
408 |
// will STILL return a fully qualified URL rather than the value of the |
|
|
409 |
// "href" attribute exactly as it was set in script. |
|
|
410 |
|
|
|
411 |
oSubmenuToggle.set("href", oToggleData.url); |
|
|
412 |
|
|
|
413 |
|
|
|
414 |
// Add a "mousedown" and "keydown" listener to each menu label that |
|
|
415 |
// will build the submenu the first time the users requests it. |
|
|
416 |
|
|
|
417 |
node.on("mousedown", addSubmenu, node, sKey); |
|
|
418 |
node.on("keydown", addSubmenu, node, sKey); |
|
|
419 |
|
|
|
420 |
node.appendChild(oSubmenuToggle); |
|
|
421 |
|
|
|
422 |
}); |
|
|
423 |
|
|
|
424 |
|
|
|
425 |
// Call the "plug" method passing in a reference to the |
|
|
426 |
// MenuNav Node Plugin. |
|
|
427 |
|
|
|
428 |
menu.plug(Y.Plugin.NodeMenuNav, { autoSubmenuDisplay: false, mouseOutHideDelay: 0 }); |
|
|
429 |
|
|
|
430 |
}); |
|
|
431 |
</textarea> |
|
|
432 |
<em>Note:</em> In keeping with the |
|
|
433 |
<a href="http://developer.yahoo.com/performance/">Exceptional Performance</a> |
|
|
434 |
team's recommendation, the script block used to instantiate the menu will be |
|
|
435 |
<a href="http://developer.yahoo.com/performance/rules.html#js_bottom">placed at the bottom of the page</a>. |
|
|
436 |
This not only improves performance, it helps ensure that the DOM subtree of the |
|
|
437 |
element representing the root menu |
|
|
438 |
(<code><div id="productsandservices"></code>) is ready to be scripted. |
|
|
439 |
</p> </div> |
|
|
440 |
<div class="yui-u sidebar"> |
|
|
441 |
|
|
|
442 |
|
|
|
443 |
<div id="examples" class="mod box4"> |
|
|
444 |
<div class="hd"> |
|
|
445 |
<h4> |
|
|
446 |
MenuNav Node Plugin Examples:</h4> |
|
|
447 |
</div> |
|
|
448 |
<div class="bd"> |
|
|
449 |
<ul> |
|
|
450 |
<li><a href='../node-menunav/node-menunav-1.html'>Basic Left Nav</a></li><li><a href='../node-menunav/node-menunav-2.html'>Basic Top Nav</a></li><li><a href='../node-menunav/node-menunav-3.html'>Menu Button Top Nav</a></li><li><a href='../node-menunav/node-menunav-4.html'>Split Button Top Nav</a></li><li><a href='../node-menunav/node-menunav-5.html'>Left Nav With Submenus With Shadows</a></li><li><a href='../node-menunav/node-menunav-6.html'>Left Nav With Submenus With Rounded Corners</a></li><li><a href='../node-menunav/node-menunav-7.html'>Skinning Menus Created Using the MenuNav Node Plugin</a></li><li class='selected'><a href='../node-menunav/node-menunav-8.html'>Adding Submenus On The Fly</a></li> </ul> |
|
|
451 |
</div> |
|
|
452 |
</div> |
|
|
453 |
|
|
|
454 |
<div class="mod box4"> |
|
|
455 |
<div class="hd"> |
|
|
456 |
<h4>More MenuNav Node Plugin Resources:</h4> |
|
|
457 |
</div> |
|
|
458 |
<div class="bd"> |
|
|
459 |
<ul> |
|
|
460 |
<!-- <li><a href="http://developer.yahoo.com/yui/node-menunav/">User's Guide</a> (external)</li> --> |
|
|
461 |
<li><a href="../../api/module_node-menunav.html">API Documentation</a></li> |
|
|
462 |
</ul> |
|
|
463 |
</div> |
|
|
464 |
</div> |
|
|
465 |
</div> |
|
|
466 |
</div> |
|
|
467 |
|
|
|
468 |
</div> |
|
|
469 |
</div> |
|
|
470 |
|
|
|
471 |
|
|
|
472 |
<div class="yui-b toc3" id="tocWrapper"> |
|
|
473 |
<!-- TABLE OF CONTENTS --> |
|
|
474 |
<div id="toc"> |
|
|
475 |
|
|
|
476 |
<ul> |
|
|
477 |
<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="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> |
|
|
478 |
</div> |
|
|
479 |
</div> |
|
|
480 |
</div><!--closes bd--> |
|
|
481 |
|
|
|
482 |
<div id="ft"> |
|
|
483 |
<p class="first">Copyright © 2009 Yahoo! Inc. All rights reserved.</p> |
|
|
484 |
<p><a href="http://privacy.yahoo.com/privacy/us/devel/index.html">Privacy Policy</a> - |
|
|
485 |
<a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> - |
|
|
486 |
<a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright Policy</a> - |
|
|
487 |
<a href="http://careers.yahoo.com/">Job Openings</a></p> |
|
|
488 |
</div> |
|
|
489 |
</div> |
|
|
490 |
<script src="../../assets/dpSyntaxHighlighter.js"></script> |
|
|
491 |
<script language="javascript"> |
|
|
492 |
dp.SyntaxHighlighter.HighlightAll('code'); |
|
|
493 |
</script> |
|
|
494 |
</body> |
|
|
495 |
</html> |