|
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: Event: Using the 'focus' and 'blur' custom events</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 |
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" /> |
|
|
18 |
<script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
|
|
19 |
|
|
|
20 |
</head> |
|
|
21 |
<body id="yahoo-com" class=" yui-skin-sam"> |
|
|
22 |
<div id="custom-doc" class="yui-t2"> |
|
|
23 |
<div id="hd"> |
|
|
24 |
<div id="ygunav"> |
|
|
25 |
<p> |
|
|
26 |
<em> |
|
|
27 |
<a href="http://developer.yahoo.com/yui/3/">YUI 3.x Home</a> <i> - </i> |
|
|
28 |
</em> |
|
|
29 |
</p> |
|
|
30 |
<form action="http://search.yahoo.com/search" id="sitesearchform"> |
|
|
31 |
<input name="vs" type="hidden" value="developer.yahoo.com"> |
|
|
32 |
<input name="vs" type="hidden" value="yuiblog.com"> |
|
|
33 |
<div id="sitesearch"> |
|
|
34 |
<label for="searchinput">Site Search (YDN & YUIBlog): </label> |
|
|
35 |
<input type="text" id="searchinput" name="p"> |
|
|
36 |
<input type="submit" value="Search" id="searchsubmit" class="ygbt"> |
|
|
37 |
</div> |
|
|
38 |
</form> |
|
|
39 |
</div> |
|
|
40 |
<div id="ygma"><a href="../../"><img src="../../assets/logo.gif" border="0" width="200" height="93"></a></div> |
|
|
41 |
<div id="pagetitle"><h1>YUI Library Examples: Event: Using the 'focus' and 'blur' custom events</h1></div> |
|
|
42 |
</div> |
|
|
43 |
<div id="bd"> |
|
|
44 |
|
|
|
45 |
<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> |
|
|
46 |
|
|
|
47 |
<div id="yui-main"> |
|
|
48 |
<div class="yui-b"> |
|
|
49 |
<div class="yui-ge"> |
|
|
50 |
<div class="yui-u first example" id="main"> |
|
|
51 |
|
|
|
52 |
<h2>Event: Using the 'focus' and 'blur' custom events</h2> |
|
|
53 |
|
|
|
54 |
<div id="example" class="promo"> |
|
|
55 |
<p> |
|
|
56 |
<p> |
|
|
57 |
This example demonstrates how to use the |
|
|
58 |
<a href="../../api/module_classnamemanager.html">ClassNameManager Utility</a> and the Event |
|
|
59 |
Utility's <a href="../../api/YUI.html#event_focus"><code>focus</code></a> and |
|
|
60 |
<a href="../../api/YUI.html#event_focus"><code>blur</code></a> custom events to skin checkboxes. |
|
|
61 |
</p> </p> |
|
|
62 |
|
|
|
63 |
<div class="module example-container "> |
|
|
64 |
<div class="hd exampleHd"> |
|
|
65 |
<p class="newWindowButton yui-skin-sam"> |
|
|
66 |
<a href="event-focus-blur_clean.html" target="_blank">View example in new window.</a> |
|
|
67 |
</p> |
|
|
68 |
</div> <div id="example-canvas" class="bd"> |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
72 |
|
|
|
73 |
<div id="checkboxes"> |
|
|
74 |
<div> |
|
|
75 |
<label for="field-1">Field 1: </label> |
|
|
76 |
<span class="yui-checkbox"> |
|
|
77 |
<span> |
|
|
78 |
<input type="checkbox" id="field-1" name="field-1" value="1"> |
|
|
79 |
</span> |
|
|
80 |
</span> |
|
|
81 |
</div> |
|
|
82 |
<div> |
|
|
83 |
<label for="field-2">Field 2: </label> |
|
|
84 |
<span class="yui-checkbox"> |
|
|
85 |
<span> |
|
|
86 |
<input type="checkbox" id="field-2" name="field-2" value="2"> |
|
|
87 |
</span> |
|
|
88 |
</span> |
|
|
89 |
</div> |
|
|
90 |
<div> |
|
|
91 |
<label for="field-3">Field 3: </label> |
|
|
92 |
<span class="yui-checkbox"> |
|
|
93 |
<span> |
|
|
94 |
<input type="checkbox" id="field-3" name="field-3" value="3"> |
|
|
95 |
</span> |
|
|
96 |
</span> |
|
|
97 |
</div> |
|
|
98 |
</div> |
|
|
99 |
|
|
|
100 |
<script type="text/javascript"> |
|
|
101 |
|
|
|
102 |
YUI({ |
|
|
103 |
|
|
|
104 |
base: "../../build/", |
|
|
105 |
|
|
|
106 |
// Load the stylesheet for the skinned checkboxes via JavaScript, since without |
|
|
107 |
// JavaScript skinning of the checkboxes wouldn't be possible. |
|
|
108 |
|
|
|
109 |
modules: { |
|
|
110 |
"checkboxcss": { |
|
|
111 |
type: "css", |
|
|
112 |
fullpath: "assets/checkbox.css" |
|
|
113 |
} |
|
|
114 |
} |
|
|
115 |
|
|
|
116 |
}).use("node", "classnamemanager", "checkboxcss", function(Y) { |
|
|
117 |
|
|
|
118 |
Y.on("contentready", function () { |
|
|
119 |
|
|
|
120 |
var getClassName = Y.ClassNameManager.getClassName, |
|
|
121 |
|
|
|
122 |
sCheckboxFocusClass = getClassName("checkbox", "focus"), // Create yui-checkbox-focus |
|
|
123 |
sCheckboxCheckedClass = getClassName("checkbox", "checked"), // Create yui-checkbox-checked |
|
|
124 |
sCheckboxActiveClass = getClassName("checkbox", "active"), // Create yui-checkbox-active |
|
|
125 |
|
|
|
126 |
forAttr = (Y.UA.ie && Y.UA.ie < 8) ? "htmlFor" : "for", |
|
|
127 |
bBlockDocumentMouseUp = false, |
|
|
128 |
bBlockClearActive = false, |
|
|
129 |
oActiveCheckbox; |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
var isLabel = function (node) { |
|
|
133 |
|
|
|
134 |
return (node.get("nodeName").toLowerCase() === "label"); |
|
|
135 |
|
|
|
136 |
}; |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
var getCheckboxForLabel = function (label) { |
|
|
140 |
|
|
|
141 |
var sID = label.getAttribute(forAttr), |
|
|
142 |
oInput, |
|
|
143 |
oCheckbox; |
|
|
144 |
|
|
|
145 |
if (sID) { |
|
|
146 |
|
|
|
147 |
oInput = Y.Node.get("#" + sID); |
|
|
148 |
|
|
|
149 |
if (oInput) { |
|
|
150 |
oCheckbox = getCheckbox(oInput); |
|
|
151 |
} |
|
|
152 |
|
|
|
153 |
} |
|
|
154 |
|
|
|
155 |
return oCheckbox; |
|
|
156 |
|
|
|
157 |
}; |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
var getCheckbox = function (node) { |
|
|
161 |
|
|
|
162 |
return (node.hasClass("yui-checkbox") ? node : node.ancestor(".yui-checkbox")); |
|
|
163 |
|
|
|
164 |
}; |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
var updateCheckedState = function (input) { |
|
|
168 |
|
|
|
169 |
var oCheckbox = getCheckbox(input); |
|
|
170 |
|
|
|
171 |
if (input.get("checked")) { |
|
|
172 |
oCheckbox.addClass(sCheckboxCheckedClass); |
|
|
173 |
} |
|
|
174 |
else { |
|
|
175 |
oCheckbox.removeClass(sCheckboxCheckedClass); |
|
|
176 |
} |
|
|
177 |
|
|
|
178 |
}; |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
var setActiveCheckbox = function (checkbox) { |
|
|
182 |
|
|
|
183 |
checkbox.addClass(sCheckboxActiveClass); |
|
|
184 |
oActiveCheckbox = checkbox; |
|
|
185 |
|
|
|
186 |
}; |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
var clearActiveCheckbox = function () { |
|
|
190 |
|
|
|
191 |
if (oActiveCheckbox) { |
|
|
192 |
oActiveCheckbox.removeClass(sCheckboxActiveClass); |
|
|
193 |
oActiveCheckbox = null; |
|
|
194 |
} |
|
|
195 |
|
|
|
196 |
}; |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
var onDocumentMouseOver = function (event) { |
|
|
200 |
|
|
|
201 |
var oCheckbox = getCheckbox(event.target); |
|
|
202 |
|
|
|
203 |
if (oActiveCheckbox && oActiveCheckbox === oCheckbox) { |
|
|
204 |
oActiveCheckbox.addClass(sCheckboxActiveClass); |
|
|
205 |
} |
|
|
206 |
|
|
|
207 |
}; |
|
|
208 |
|
|
|
209 |
|
|
|
210 |
var onDocumentMouseOut = function (event) { |
|
|
211 |
|
|
|
212 |
var oCheckbox = getCheckbox(event.target); |
|
|
213 |
|
|
|
214 |
if (oActiveCheckbox && oActiveCheckbox === oCheckbox) { |
|
|
215 |
oActiveCheckbox.removeClass(sCheckboxActiveClass); |
|
|
216 |
} |
|
|
217 |
|
|
|
218 |
}; |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
var onDocumentMouseUp = function (event) { |
|
|
222 |
|
|
|
223 |
var oCheckbox; |
|
|
224 |
|
|
|
225 |
if (!bBlockDocumentMouseUp) { |
|
|
226 |
|
|
|
227 |
oCheckbox = getCheckbox(event.target); |
|
|
228 |
|
|
|
229 |
if ((oCheckbox && oActiveCheckbox !== oCheckbox) || !oCheckbox) { |
|
|
230 |
clearActiveCheckbox(); |
|
|
231 |
} |
|
|
232 |
|
|
|
233 |
} |
|
|
234 |
|
|
|
235 |
bBlockDocumentMouseUp = false; |
|
|
236 |
|
|
|
237 |
}; |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
var onDocumentKeyUp = function (event) { |
|
|
241 |
|
|
|
242 |
var oCheckbox = getCheckbox(event.target); |
|
|
243 |
|
|
|
244 |
if ((oCheckbox && oActiveCheckbox !== oCheckbox) || !oCheckbox) { |
|
|
245 |
clearActiveCheckbox(); |
|
|
246 |
} |
|
|
247 |
|
|
|
248 |
}; |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
var onCheckboxFocus = function (event) { |
|
|
252 |
|
|
|
253 |
var oCheckbox = getCheckbox(event.target); |
|
|
254 |
|
|
|
255 |
if (oCheckbox) { |
|
|
256 |
oCheckbox.addClass(sCheckboxFocusClass); |
|
|
257 |
} |
|
|
258 |
|
|
|
259 |
}; |
|
|
260 |
|
|
|
261 |
|
|
|
262 |
var onCheckboxBlur = function (event) { |
|
|
263 |
|
|
|
264 |
var oCheckbox = getCheckbox(event.target); |
|
|
265 |
|
|
|
266 |
if (oCheckbox) { |
|
|
267 |
|
|
|
268 |
oCheckbox.removeClass(sCheckboxFocusClass); |
|
|
269 |
|
|
|
270 |
if (!bBlockClearActive && oCheckbox && oCheckbox === oActiveCheckbox) { |
|
|
271 |
clearActiveCheckbox(); |
|
|
272 |
} |
|
|
273 |
|
|
|
274 |
} |
|
|
275 |
|
|
|
276 |
bBlockClearActive = false; |
|
|
277 |
|
|
|
278 |
}; |
|
|
279 |
|
|
|
280 |
|
|
|
281 |
var onCheckboxClick = function (event) { |
|
|
282 |
|
|
|
283 |
var oTarget = event.target, |
|
|
284 |
oCheckbox = getCheckbox(oTarget), |
|
|
285 |
oInput; |
|
|
286 |
|
|
|
287 |
if (!isLabel(oTarget) && oCheckbox && oCheckbox === oActiveCheckbox) { |
|
|
288 |
|
|
|
289 |
oInput = oCheckbox.query("input"); |
|
|
290 |
|
|
|
291 |
if (oInput) { |
|
|
292 |
|
|
|
293 |
// If the click event was fired via the keyboard, the target |
|
|
294 |
// will be the input elment and the checked state of the input |
|
|
295 |
// element will therefore already be updated. If the click event |
|
|
296 |
// was fired via the mouse, the checked state will have to be |
|
|
297 |
// manually updated since the input is hidden offscreen and |
|
|
298 |
// therefore couldn't be the target of the click. |
|
|
299 |
|
|
|
300 |
if (oTarget !== oInput) { |
|
|
301 |
oInput.set("checked", (!oInput.get("checked"))); |
|
|
302 |
} |
|
|
303 |
|
|
|
304 |
updateCheckedState(oInput); |
|
|
305 |
clearActiveCheckbox(); |
|
|
306 |
|
|
|
307 |
} |
|
|
308 |
|
|
|
309 |
} |
|
|
310 |
|
|
|
311 |
}; |
|
|
312 |
|
|
|
313 |
|
|
|
314 |
var onCheckboxMouseDown = function (event) { |
|
|
315 |
|
|
|
316 |
var oTarget = event.target, |
|
|
317 |
oCheckbox = getCheckbox(oTarget), |
|
|
318 |
bTargetIsLabel = isLabel(oTarget), |
|
|
319 |
oInput; |
|
|
320 |
|
|
|
321 |
if (bTargetIsLabel) { |
|
|
322 |
|
|
|
323 |
oCheckbox = getCheckboxForLabel(oTarget); |
|
|
324 |
|
|
|
325 |
// If the target of the event was the checkbox's label element, the |
|
|
326 |
// label will dispatch a click event to the checkbox, meaning the |
|
|
327 |
// "onCheckboxClick" handler will be called twice. For that reason |
|
|
328 |
// it is necessary to block the "onDocumentMouseUp" handler from |
|
|
329 |
// clearing the active state, so that a reference to the active |
|
|
330 |
// checkbox still exists the second time the "onCheckboxClick" |
|
|
331 |
// handler is called. |
|
|
332 |
|
|
|
333 |
bBlockDocumentMouseUp = true; |
|
|
334 |
|
|
|
335 |
// When the user clicks the label instead of the checkbox itself, |
|
|
336 |
// the checkbox will be blurred if it has focus. Since the |
|
|
337 |
// "onCheckboxBlur" handler clears the active state it is |
|
|
338 |
// necessary to block the clearing of the active state when the |
|
|
339 |
// label is clicked instead of the checkbox itself. |
|
|
340 |
|
|
|
341 |
bBlockClearActive = true; |
|
|
342 |
|
|
|
343 |
} |
|
|
344 |
|
|
|
345 |
|
|
|
346 |
if (oCheckbox) { |
|
|
347 |
|
|
|
348 |
if (!bTargetIsLabel) { |
|
|
349 |
|
|
|
350 |
oInput = oCheckbox.query("input"); |
|
|
351 |
|
|
|
352 |
if (oInput) { |
|
|
353 |
oInput.focus(); |
|
|
354 |
} |
|
|
355 |
|
|
|
356 |
// Prevent text selection if the user moves the mouse over the |
|
|
357 |
// document after mousing down on the checkbox |
|
|
358 |
|
|
|
359 |
event.preventDefault(); |
|
|
360 |
|
|
|
361 |
} |
|
|
362 |
|
|
|
363 |
setActiveCheckbox(oCheckbox); |
|
|
364 |
|
|
|
365 |
} |
|
|
366 |
|
|
|
367 |
}; |
|
|
368 |
|
|
|
369 |
|
|
|
370 |
var onCheckboxKeyDown = function (event) { |
|
|
371 |
|
|
|
372 |
var oCheckbox = getCheckbox(event.target); |
|
|
373 |
|
|
|
374 |
// Active the checkbox when the user presses the space bar |
|
|
375 |
if (oCheckbox && event.keyCode === 32) { |
|
|
376 |
setActiveCheckbox(oCheckbox); |
|
|
377 |
} |
|
|
378 |
|
|
|
379 |
}; |
|
|
380 |
|
|
|
381 |
|
|
|
382 |
var oDocument = Y.Node.get("#checkboxes").get("ownerDocument"); |
|
|
383 |
|
|
|
384 |
oDocument.on("mouseover", onDocumentMouseOver); |
|
|
385 |
oDocument.on("mouseout", onDocumentMouseOut); |
|
|
386 |
oDocument.on("mouseup", onDocumentMouseUp); |
|
|
387 |
oDocument.on("keyup", onDocumentKeyUp); |
|
|
388 |
|
|
|
389 |
Y.on("mousedown", onCheckboxMouseDown, "#checkboxes"); |
|
|
390 |
Y.on("keydown", onCheckboxKeyDown, "#checkboxes"); |
|
|
391 |
Y.on("click", onCheckboxClick, "#checkboxes"); |
|
|
392 |
Y.on("focus", onCheckboxFocus, "#checkboxes"); |
|
|
393 |
Y.on("blur", onCheckboxBlur, "#checkboxes"); |
|
|
394 |
|
|
|
395 |
}, "#checkboxes"); |
|
|
396 |
}); |
|
|
397 |
|
|
|
398 |
</script> |
|
|
399 |
|
|
|
400 |
<!--END SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
401 |
|
|
|
402 |
|
|
|
403 |
</div> |
|
|
404 |
</div> |
|
|
405 |
</div> |
|
|
406 |
|
|
|
407 |
<h3>Challenges</h3> |
|
|
408 |
<p> |
|
|
409 |
There are a few challenges when trying to skin an HTML checkbox using CSS. To start, most of the |
|
|
410 |
<a href="http://developer.yahoo.com/yui/articles/gbs/#a-grade">A-grade browsers</a> don't provide |
|
|
411 |
support for CSS properties like <code>border</code> and <code>background</code> on the |
|
|
412 |
<code><input type="checkbox"></code> element. Additionally, IE 6 and IE 7 (Quirks Mode) |
|
|
413 |
lack support for attribute selectors — necessary to style the <code>checked</code> and |
|
|
414 |
<code>disabled</code> states. Additionally, IE 6 and 7 only support the <code>:focus</code> and |
|
|
415 |
<code>:active</code> pseudo classes on <code><a></code> elements, both of which are needed |
|
|
416 |
to style a checkbox when it is focused or depressed. |
|
|
417 |
</p> |
|
|
418 |
|
|
|
419 |
<h3>Approach</h3> |
|
|
420 |
<p> |
|
|
421 |
Despite the shortcomings in CSS support, with a little extra markup and through the use of |
|
|
422 |
JavaScript it is possible to skin an <code><input type="checkbox"></code> element |
|
|
423 |
consistently well in all of the |
|
|
424 |
<a href="http://developer.yahoo.com/yui/articles/gbs/#a-grade">A-grade browsers</a>. |
|
|
425 |
</p> |
|
|
426 |
|
|
|
427 |
|
|
|
428 |
<h4>Markup</h4> |
|
|
429 |
<p> |
|
|
430 |
Since CSS support for the <code><input type="checkbox"></code> element is lacking, wrap |
|
|
431 |
<code><input type="checkbox"></code> elements in one or more inline elements to provide the |
|
|
432 |
necessary hooks for styling. In this example, each <code><input type="checkbox"></code> |
|
|
433 |
element is wrapped by two <code><span></code>s. |
|
|
434 |
</p> |
|
|
435 |
|
|
|
436 |
<textarea name="code" class="HTML" cols="60" rows="1"> |
|
|
437 |
<span class="yui-checkbox"> |
|
|
438 |
<span> |
|
|
439 |
<input type="checkbox"> |
|
|
440 |
</span> |
|
|
441 |
</span> |
|
|
442 |
</textarea> |
|
|
443 |
|
|
|
444 |
<h4>CSS</h4> |
|
|
445 |
<p> |
|
|
446 |
To style each checkbox, a class name of <code>yui-checkbox</code> will be applied to the |
|
|
447 |
outtermost <code><span></code> wrapping each <code><input type="checkbox"></code> |
|
|
448 |
element. An additional class will be used to represent the various states of each checkbox. The |
|
|
449 |
class name for each state will follow a consistent pattern: <code>yui-checkbox-[state]</code>. |
|
|
450 |
For this example, the following state-based class names will be used: |
|
|
451 |
</p> |
|
|
452 |
<dl> |
|
|
453 |
<dt><code>yui-checkbox-focus</code></dt> |
|
|
454 |
<dd>The checkbox has focus</dd> |
|
|
455 |
<dt><code>yui-checkbox-active</code></dt> |
|
|
456 |
<dd>The checkbox is active (pressed)</dd> |
|
|
457 |
<dt><code>yui-checkbox-checked</code></dt> |
|
|
458 |
<dd>The checkbox is checked</dd> |
|
|
459 |
</dl> |
|
|
460 |
<p> |
|
|
461 |
All of the classes used for skinning the checkbox will be created using the |
|
|
462 |
<a href="../../api/module_classnamemanager.html">ClassNameManager Utility</a>, since it makes for |
|
|
463 |
easy generation and management of prefixed class names. The styles for each checkbox comes together |
|
|
464 |
as follows: |
|
|
465 |
</p> |
|
|
466 |
|
|
|
467 |
<textarea name="code" class="CSS" cols="60" rows="1"> |
|
|
468 |
.yui-checkbox { |
|
|
469 |
|
|
|
470 |
display: -moz-inline-stack; /* Gecko < 1.9, since it doesn't support "inline-block" */ |
|
|
471 |
display: inline-block; /* IE, Opera and Webkit, and Gecko 1.9 */ |
|
|
472 |
width: 10px; |
|
|
473 |
height: 10px; |
|
|
474 |
border: inset 2px #999; |
|
|
475 |
|
|
|
476 |
/* |
|
|
477 |
Necessary for IE 6 (Quirks and Standards Mode) and IE 7 (Quirks Mode), since |
|
|
478 |
they don't support use of negative margins without relative positioning. |
|
|
479 |
*/ |
|
|
480 |
|
|
|
481 |
_position: relative; |
|
|
482 |
} |
|
|
483 |
|
|
|
484 |
.yui-checkbox span { |
|
|
485 |
|
|
|
486 |
display: block; |
|
|
487 |
height: 14px; |
|
|
488 |
width: 12px; |
|
|
489 |
overflow: hidden; |
|
|
490 |
|
|
|
491 |
/* Position the checkmark for Gecko, Opera and Webkit and IE 7 (Strict Mode). */ |
|
|
492 |
margin: -5px 0 0 1px; |
|
|
493 |
|
|
|
494 |
|
|
|
495 |
/* Position the checkmark for IE 6 (Strict and Quirks Mode) and IE 7 (Quirks Mode).*/ |
|
|
496 |
_margin: 0; |
|
|
497 |
_position: absolute; |
|
|
498 |
_top: -5px; |
|
|
499 |
_left: 1px; |
|
|
500 |
|
|
|
501 |
} |
|
|
502 |
|
|
|
503 |
/* For Gecko < 1.9: Positions the checkbox on the same line as its corresponding label. */ |
|
|
504 |
.yui-checkbox span:after { |
|
|
505 |
|
|
|
506 |
content: "."; |
|
|
507 |
visibility: hidden; |
|
|
508 |
line-height: 2; |
|
|
509 |
|
|
|
510 |
} |
|
|
511 |
|
|
|
512 |
/* |
|
|
513 |
Hide the actual checkbox offscreen so that it is out of view, but still accessible via |
|
|
514 |
the keyboard. |
|
|
515 |
*/ |
|
|
516 |
.yui-checkbox input { |
|
|
517 |
|
|
|
518 |
position: absolute; |
|
|
519 |
left: -10000px; |
|
|
520 |
|
|
|
521 |
} |
|
|
522 |
|
|
|
523 |
.yui-checkbox-focus { |
|
|
524 |
|
|
|
525 |
border-color: #39f; |
|
|
526 |
background-color: #9cf; |
|
|
527 |
|
|
|
528 |
} |
|
|
529 |
|
|
|
530 |
.yui-checkbox-active { |
|
|
531 |
|
|
|
532 |
background-color: #ccc; |
|
|
533 |
|
|
|
534 |
} |
|
|
535 |
|
|
|
536 |
.yui-checkbox-checked span { |
|
|
537 |
|
|
|
538 |
/* Draw a custom checkmark for the checked state using a background image. */ |
|
|
539 |
background: url(checkmark.png) no-repeat; |
|
|
540 |
|
|
|
541 |
} |
|
|
542 |
</textarea> |
|
|
543 |
|
|
|
544 |
<h4>JavaScript</h4> |
|
|
545 |
|
|
|
546 |
<p> |
|
|
547 |
Application and removal of the state-based class names will be facilitated by JavaScript event |
|
|
548 |
handlers. Each event handler will track the state of the |
|
|
549 |
<code><input type="checkbox"></code> element, and apply and remove corresponding |
|
|
550 |
state-based class names from its outtermost <code><span></code> — |
|
|
551 |
making it easy to style each state. And since each JavaScript is required for state management, |
|
|
552 |
the stylesheet for the skinned checkboxes will only be added to the page when JavaScript is |
|
|
553 |
enabled. This will ensure that each checkbox works correctly with and without JavaScript enabled. |
|
|
554 |
</p> |
|
|
555 |
|
|
|
556 |
<p> |
|
|
557 |
Since there could easily be many instances of a skinned checkbox on the page, all event |
|
|
558 |
listeners will be attached to the containing element for all checkboxes. Each listener will |
|
|
559 |
listen for events as they bubble up from each checkbox. Relying on event bubbling will improve the |
|
|
560 |
overall performance of the page by reducing the number of event handlers. |
|
|
561 |
</p> |
|
|
562 |
|
|
|
563 |
<p> |
|
|
564 |
Since the DOM <code>focus</code> and <code>blur</code> events do not bubble, use the Event Utility's |
|
|
565 |
<a href="../../api/YUI.html#event_focus"><code>focus</code></a> and |
|
|
566 |
<a href="../../api/YUI.html#event_focus"><code>blur</code></a> custom events, as an alternative to |
|
|
567 |
attaching discrete focus and blur event handlers to the <code><input type="checkbox"></code> |
|
|
568 |
element of each skinned checkbox. The |
|
|
569 |
<a href="../../api/YUI.html#event_focus"><code>focus</code></a> and |
|
|
570 |
<a href="../../api/YUI.html#event_focus"><code>blur</code></a> custom events leverage |
|
|
571 |
capture-phase DOM event listeners, making it possible to attach a single focus and blur event |
|
|
572 |
listener on the containing element of each checkbox — thereby increasing the performance |
|
|
573 |
of the page. The complete script for the example comes together as follows: |
|
|
574 |
</p> |
|
|
575 |
|
|
|
576 |
<textarea name="code" class="JScript" cols="60" rows="1"> |
|
|
577 |
YUI({ |
|
|
578 |
|
|
|
579 |
base: "../../build/", |
|
|
580 |
|
|
|
581 |
// Load the stylesheet for the skinned checkboxes via JavaScript, since without |
|
|
582 |
// JavaScript skinning of the checkboxes wouldn't be possible. |
|
|
583 |
|
|
|
584 |
modules: { |
|
|
585 |
"checkboxcss": { |
|
|
586 |
type: "css", |
|
|
587 |
fullpath: "assets/checkbox.css" |
|
|
588 |
} |
|
|
589 |
} |
|
|
590 |
|
|
|
591 |
}).use("node", "classnamemanager", "checkboxcss", function(Y) { |
|
|
592 |
|
|
|
593 |
Y.on("contentready", function () { |
|
|
594 |
|
|
|
595 |
var getClassName = Y.ClassNameManager.getClassName, |
|
|
596 |
|
|
|
597 |
sCheckboxFocusClass = getClassName("checkbox", "focus"), // Create yui-checkbox-focus |
|
|
598 |
sCheckboxCheckedClass = getClassName("checkbox", "checked"), // Create yui-checkbox-checked |
|
|
599 |
sCheckboxActiveClass = getClassName("checkbox", "active"), // Create yui-checkbox-active |
|
|
600 |
|
|
|
601 |
forAttr = (Y.UA.ie && Y.UA.ie < 8) ? "htmlFor" : "for", |
|
|
602 |
bBlockDocumentMouseUp = false, |
|
|
603 |
bBlockClearActive = false, |
|
|
604 |
oActiveCheckbox; |
|
|
605 |
|
|
|
606 |
|
|
|
607 |
var isLabel = function (node) { |
|
|
608 |
|
|
|
609 |
return (node.get("nodeName").toLowerCase() === "label"); |
|
|
610 |
|
|
|
611 |
}; |
|
|
612 |
|
|
|
613 |
|
|
|
614 |
var getCheckboxForLabel = function (label) { |
|
|
615 |
|
|
|
616 |
var sID = label.getAttribute(forAttr), |
|
|
617 |
oInput, |
|
|
618 |
oCheckbox; |
|
|
619 |
|
|
|
620 |
if (sID) { |
|
|
621 |
|
|
|
622 |
oInput = Y.Node.get("#" + sID); |
|
|
623 |
|
|
|
624 |
if (oInput) { |
|
|
625 |
oCheckbox = getCheckbox(oInput); |
|
|
626 |
} |
|
|
627 |
|
|
|
628 |
} |
|
|
629 |
|
|
|
630 |
return oCheckbox; |
|
|
631 |
|
|
|
632 |
}; |
|
|
633 |
|
|
|
634 |
|
|
|
635 |
var getCheckbox = function (node) { |
|
|
636 |
|
|
|
637 |
return (node.hasClass("yui-checkbox") ? node : node.ancestor(".yui-checkbox")); |
|
|
638 |
|
|
|
639 |
}; |
|
|
640 |
|
|
|
641 |
|
|
|
642 |
var updateCheckedState = function (input) { |
|
|
643 |
|
|
|
644 |
var oCheckbox = getCheckbox(input); |
|
|
645 |
|
|
|
646 |
if (input.get("checked")) { |
|
|
647 |
oCheckbox.addClass(sCheckboxCheckedClass); |
|
|
648 |
} |
|
|
649 |
else { |
|
|
650 |
oCheckbox.removeClass(sCheckboxCheckedClass); |
|
|
651 |
} |
|
|
652 |
|
|
|
653 |
}; |
|
|
654 |
|
|
|
655 |
|
|
|
656 |
var setActiveCheckbox = function (checkbox) { |
|
|
657 |
|
|
|
658 |
checkbox.addClass(sCheckboxActiveClass); |
|
|
659 |
oActiveCheckbox = checkbox; |
|
|
660 |
|
|
|
661 |
}; |
|
|
662 |
|
|
|
663 |
|
|
|
664 |
var clearActiveCheckbox = function () { |
|
|
665 |
|
|
|
666 |
if (oActiveCheckbox) { |
|
|
667 |
oActiveCheckbox.removeClass(sCheckboxActiveClass); |
|
|
668 |
oActiveCheckbox = null; |
|
|
669 |
} |
|
|
670 |
|
|
|
671 |
}; |
|
|
672 |
|
|
|
673 |
|
|
|
674 |
var onDocumentMouseOver = function (event) { |
|
|
675 |
|
|
|
676 |
var oCheckbox = getCheckbox(event.target); |
|
|
677 |
|
|
|
678 |
if (oActiveCheckbox && oActiveCheckbox === oCheckbox) { |
|
|
679 |
oActiveCheckbox.addClass(sCheckboxActiveClass); |
|
|
680 |
} |
|
|
681 |
|
|
|
682 |
}; |
|
|
683 |
|
|
|
684 |
|
|
|
685 |
var onDocumentMouseOut = function (event) { |
|
|
686 |
|
|
|
687 |
var oCheckbox = getCheckbox(event.target); |
|
|
688 |
|
|
|
689 |
if (oActiveCheckbox && oActiveCheckbox === oCheckbox) { |
|
|
690 |
oActiveCheckbox.removeClass(sCheckboxActiveClass); |
|
|
691 |
} |
|
|
692 |
|
|
|
693 |
}; |
|
|
694 |
|
|
|
695 |
|
|
|
696 |
var onDocumentMouseUp = function (event) { |
|
|
697 |
|
|
|
698 |
var oCheckbox; |
|
|
699 |
|
|
|
700 |
if (!bBlockDocumentMouseUp) { |
|
|
701 |
|
|
|
702 |
oCheckbox = getCheckbox(event.target); |
|
|
703 |
|
|
|
704 |
if ((oCheckbox && oActiveCheckbox !== oCheckbox) || !oCheckbox) { |
|
|
705 |
clearActiveCheckbox(); |
|
|
706 |
} |
|
|
707 |
|
|
|
708 |
} |
|
|
709 |
|
|
|
710 |
bBlockDocumentMouseUp = false; |
|
|
711 |
|
|
|
712 |
}; |
|
|
713 |
|
|
|
714 |
|
|
|
715 |
var onDocumentKeyUp = function (event) { |
|
|
716 |
|
|
|
717 |
var oCheckbox = getCheckbox(event.target); |
|
|
718 |
|
|
|
719 |
if ((oCheckbox && oActiveCheckbox !== oCheckbox) || !oCheckbox) { |
|
|
720 |
clearActiveCheckbox(); |
|
|
721 |
} |
|
|
722 |
|
|
|
723 |
}; |
|
|
724 |
|
|
|
725 |
|
|
|
726 |
var onCheckboxFocus = function (event) { |
|
|
727 |
|
|
|
728 |
var oCheckbox = getCheckbox(event.target); |
|
|
729 |
|
|
|
730 |
if (oCheckbox) { |
|
|
731 |
oCheckbox.addClass(sCheckboxFocusClass); |
|
|
732 |
} |
|
|
733 |
|
|
|
734 |
}; |
|
|
735 |
|
|
|
736 |
|
|
|
737 |
var onCheckboxBlur = function (event) { |
|
|
738 |
|
|
|
739 |
var oCheckbox = getCheckbox(event.target); |
|
|
740 |
|
|
|
741 |
if (oCheckbox) { |
|
|
742 |
|
|
|
743 |
oCheckbox.removeClass(sCheckboxFocusClass); |
|
|
744 |
|
|
|
745 |
if (!bBlockClearActive && oCheckbox && oCheckbox === oActiveCheckbox) { |
|
|
746 |
clearActiveCheckbox(); |
|
|
747 |
} |
|
|
748 |
|
|
|
749 |
} |
|
|
750 |
|
|
|
751 |
bBlockClearActive = false; |
|
|
752 |
|
|
|
753 |
}; |
|
|
754 |
|
|
|
755 |
|
|
|
756 |
var onCheckboxClick = function (event) { |
|
|
757 |
|
|
|
758 |
var oTarget = event.target, |
|
|
759 |
oCheckbox = getCheckbox(oTarget), |
|
|
760 |
oInput; |
|
|
761 |
|
|
|
762 |
if (!isLabel(oTarget) && oCheckbox && oCheckbox === oActiveCheckbox) { |
|
|
763 |
|
|
|
764 |
oInput = oCheckbox.query("input"); |
|
|
765 |
|
|
|
766 |
if (oInput) { |
|
|
767 |
|
|
|
768 |
// If the click event was fired via the keyboard, the target |
|
|
769 |
// will be the input elment and the checked state of the input |
|
|
770 |
// element will therefore already be updated. If the click event |
|
|
771 |
// was fired via the mouse, the checked state will have to be |
|
|
772 |
// manually updated since the input is hidden offscreen and |
|
|
773 |
// therefore couldn't be the target of the click. |
|
|
774 |
|
|
|
775 |
if (oTarget !== oInput) { |
|
|
776 |
oInput.set("checked", (!oInput.get("checked"))); |
|
|
777 |
} |
|
|
778 |
|
|
|
779 |
updateCheckedState(oInput); |
|
|
780 |
clearActiveCheckbox(); |
|
|
781 |
|
|
|
782 |
} |
|
|
783 |
|
|
|
784 |
} |
|
|
785 |
|
|
|
786 |
}; |
|
|
787 |
|
|
|
788 |
|
|
|
789 |
var onCheckboxMouseDown = function (event) { |
|
|
790 |
|
|
|
791 |
var oTarget = event.target, |
|
|
792 |
oCheckbox = getCheckbox(oTarget), |
|
|
793 |
bTargetIsLabel = isLabel(oTarget), |
|
|
794 |
oInput; |
|
|
795 |
|
|
|
796 |
if (bTargetIsLabel) { |
|
|
797 |
|
|
|
798 |
oCheckbox = getCheckboxForLabel(oTarget); |
|
|
799 |
|
|
|
800 |
// If the target of the event was the checkbox's label element, the |
|
|
801 |
// label will dispatch a click event to the checkbox, meaning the |
|
|
802 |
// "onCheckboxClick" handler will be called twice. For that reason |
|
|
803 |
// it is necessary to block the "onDocumentMouseUp" handler from |
|
|
804 |
// clearing the active state, so that a reference to the active |
|
|
805 |
// checkbox still exists the second time the "onCheckboxClick" |
|
|
806 |
// handler is called. |
|
|
807 |
|
|
|
808 |
bBlockDocumentMouseUp = true; |
|
|
809 |
|
|
|
810 |
// When the user clicks the label instead of the checkbox itself, |
|
|
811 |
// the checkbox will be blurred if it has focus. Since the |
|
|
812 |
// "onCheckboxBlur" handler clears the active state it is |
|
|
813 |
// necessary to block the clearing of the active state when the |
|
|
814 |
// label is clicked instead of the checkbox itself. |
|
|
815 |
|
|
|
816 |
bBlockClearActive = true; |
|
|
817 |
|
|
|
818 |
} |
|
|
819 |
|
|
|
820 |
|
|
|
821 |
if (oCheckbox) { |
|
|
822 |
|
|
|
823 |
if (!bTargetIsLabel) { |
|
|
824 |
|
|
|
825 |
oInput = oCheckbox.query("input"); |
|
|
826 |
|
|
|
827 |
if (oInput) { |
|
|
828 |
oInput.focus(); |
|
|
829 |
} |
|
|
830 |
|
|
|
831 |
// Prevent text selection if the user moves the mouse over the |
|
|
832 |
// document after mousing down on the checkbox |
|
|
833 |
|
|
|
834 |
event.preventDefault(); |
|
|
835 |
|
|
|
836 |
} |
|
|
837 |
|
|
|
838 |
setActiveCheckbox(oCheckbox); |
|
|
839 |
|
|
|
840 |
} |
|
|
841 |
|
|
|
842 |
}; |
|
|
843 |
|
|
|
844 |
|
|
|
845 |
var onCheckboxKeyDown = function (event) { |
|
|
846 |
|
|
|
847 |
var oCheckbox = getCheckbox(event.target); |
|
|
848 |
|
|
|
849 |
// Active the checkbox when the user presses the space bar |
|
|
850 |
if (oCheckbox && event.keyCode === 32) { |
|
|
851 |
setActiveCheckbox(oCheckbox); |
|
|
852 |
} |
|
|
853 |
|
|
|
854 |
}; |
|
|
855 |
|
|
|
856 |
|
|
|
857 |
var oDocument = Y.Node.get("#checkboxes").get("ownerDocument"); |
|
|
858 |
|
|
|
859 |
oDocument.on("mouseover", onDocumentMouseOver); |
|
|
860 |
oDocument.on("mouseout", onDocumentMouseOut); |
|
|
861 |
oDocument.on("mouseup", onDocumentMouseUp); |
|
|
862 |
oDocument.on("keyup", onDocumentKeyUp); |
|
|
863 |
|
|
|
864 |
Y.on("mousedown", onCheckboxMouseDown, "#checkboxes"); |
|
|
865 |
Y.on("keydown", onCheckboxKeyDown, "#checkboxes"); |
|
|
866 |
Y.on("click", onCheckboxClick, "#checkboxes"); |
|
|
867 |
Y.on("focus", onCheckboxFocus, "#checkboxes"); |
|
|
868 |
Y.on("blur", onCheckboxBlur, "#checkboxes"); |
|
|
869 |
|
|
|
870 |
}, "#checkboxes"); |
|
|
871 |
}); |
|
|
872 |
</textarea> </div> |
|
|
873 |
<div class="yui-u sidebar"> |
|
|
874 |
|
|
|
875 |
|
|
|
876 |
<div id="examples" class="mod box4"> |
|
|
877 |
<div class="hd"> |
|
|
878 |
<h4> |
|
|
879 |
Event Examples:</h4> |
|
|
880 |
</div> |
|
|
881 |
<div class="bd"> |
|
|
882 |
<ul> |
|
|
883 |
<li><a href='../event/event-simple.html'>Simple DOM Events</a></li><li><a href='../event/event-timing.html'>Using 'available', 'contentready', and 'domready'</a></li><li><a href='../event/event-ce.html'>Using Custom Events</a></li><li class='selected'><a href='../event/event-focus-blur.html'>Using the 'focus' and 'blur' custom events</a></li><li><a href='../yui/yui-augment.html'>Compose Classes of Objects with <code>augment</code> (included with examples for The YUI Global Object)</a></li><li><a href='../node-focusmanager/node-focusmanager-3.html'>Accessible Menu Button (included with examples for Focus Manager Node Plugin)</a></li><li><a href='../node-focusmanager/node-focusmanager-2.html'>Accessible TabView (included with examples for Focus Manager Node Plugin)</a></li><li><a href='../attribute/attribute-event.html'>Change Events (included with examples for Attribute)</a></li><li><a href='../widget/widget-extend.html'>Extending the base widget class (included with examples for Widget)</a></li><li><a href='../attribute/attribute-getset.html'>Getters, Setters and Validators (included with examples for Attribute)</a></li><li><a href='../dd/photo-browser.html'>Photo Browser (included with examples for Drag & Drop)</a></li> </ul> |
|
|
884 |
</div> |
|
|
885 |
</div> |
|
|
886 |
|
|
|
887 |
<div class="mod box4"> |
|
|
888 |
<div class="hd"> |
|
|
889 |
<h4>More Event Resources:</h4> |
|
|
890 |
</div> |
|
|
891 |
<div class="bd"> |
|
|
892 |
<ul> |
|
|
893 |
<!-- <li><a href="http://developer.yahoo.com/yui/event/">User's Guide</a> (external)</li> --> |
|
|
894 |
<li><a href="../../api/module_event.html">API Documentation</a></li> |
|
|
895 |
</ul> |
|
|
896 |
</div> |
|
|
897 |
</div> |
|
|
898 |
</div> |
|
|
899 |
</div> |
|
|
900 |
|
|
|
901 |
</div> |
|
|
902 |
</div> |
|
|
903 |
|
|
|
904 |
|
|
|
905 |
<div class="yui-b toc3" id="tocWrapper"> |
|
|
906 |
<!-- TABLE OF CONTENTS --> |
|
|
907 |
<div id="toc"> |
|
|
908 |
|
|
|
909 |
<ul> |
|
|
910 |
<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="selected "><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> |
|
|
911 |
</div> |
|
|
912 |
</div> |
|
|
913 |
</div><!--closes bd--> |
|
|
914 |
|
|
|
915 |
<div id="ft"> |
|
|
916 |
<p class="first">Copyright © 2009 Yahoo! Inc. All rights reserved.</p> |
|
|
917 |
<p><a href="http://privacy.yahoo.com/privacy/us/devel/index.html">Privacy Policy</a> - |
|
|
918 |
<a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> - |
|
|
919 |
<a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright Policy</a> - |
|
|
920 |
<a href="http://careers.yahoo.com/">Job Openings</a></p> |
|
|
921 |
</div> |
|
|
922 |
</div> |
|
|
923 |
<script src="../../assets/dpSyntaxHighlighter.js"></script> |
|
|
924 |
<script language="javascript"> |
|
|
925 |
dp.SyntaxHighlighter.HighlightAll('code'); |
|
|
926 |
</script> |
|
|
927 |
</body> |
|
|
928 |
</html> |