1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4
<title>Widget Class</title>
6
<link rel="stylesheet" type="text/css" href="../../../../build/cssreset/reset.css" />
7
<link rel="stylesheet" type="text/css" href="../../../../build/cssfonts/fonts.css" />
9
<script type="text/javascript" src="../../../../build/yui/yui.js"></script>
23
background-color:#0000ff;
26
.yui3-overlay .yui3-overlay-content {
27
border:5px solid #000000;
29
background-color:#eee;
32
.yui3-overlay .yui3-widget-stdmod span {
33
background-color:#000;
37
.yui3-overlay .yui3-widget-stdmod .yui3-widget-hd {
39
background-color:#cc0000;
44
.yui3-overlay .yui3-widget-stdmod .yui3-widget-bd {
45
font-family:monospace;
46
border:2px solid blue;
50
.yui3-overlay .yui3-widget-stdmod .yui3-widget-ft {
51
border:2px solid green;
52
background-color:#00cc00;
67
filter:alpha(opacity=50);
74
border:1px solid black;
75
background-color:#cc0000;
79
<body class="yui3-skin-sam">
82
<button id="control-run" type="button">run</button>
83
<button id="control-show" type="button">show</button>
84
<button id="control-hide" type="button">hide</button>
86
<div style="overflow:auto;width:20em;height:5em">
87
<div style="height:200em"></div>
90
<select class="hideme"><option>Foo</option></select>
91
<select class="hideme"><option>Foo</option></select>
92
<select class="hideme"><option>Foo</option></select>
93
<select class="hideme"><option>Foo</option></select>
94
<select class="hideme"><option>Foo</option></select>
95
<select class="hideme"><option>Foo</option></select>
96
<select class="hideme"><option>Foo</option></select>
97
<select class="hideme"><option>Foo</option></select>
98
<select class="hideme"><option>Foo</option></select>
99
<select class="hideme"><option>Foo</option></select>
100
<select class="hideme"><option>Foo</option></select>
101
<select class="hideme"><option>Foo</option></select>
102
<select class="hideme"><option>Foo</option></select>
103
<select class="hideme"><option>Foo</option></select>
104
<select class="hideme"><option>Foo</option></select>
105
<select class="hideme"><option>Foo</option></select>
106
<select class="hideme"><option>Foo</option></select>
107
<select class="hideme"><option>Foo</option></select>
114
<div class="foo" id="foobar"></div>
116
<div id="fromMarkup">
117
<div class="yui3-widget-hd">
118
<span>Header From Markup</span>
120
<div class="yui3-widget-bd">
121
<span>Body From Markup</span>
123
<div id="fourth" class="yui3-widget-ft">
124
<span>Footer From Markup</span>
128
<script type="text/javascript">
131
YUI({filter:"raw"}).use("async-queue", "overlay", function(Y) {
133
widget = new Y.Overlay({
135
align:{node:'#align', points:["tr", "tl"]},
137
headerContent:"Overlay Header",
138
bodyContent:"width:12em, #align, tr, tl, zIndex:5",
139
footerContent:"Overlay Footer",
143
widget.after("xyChange", function(e) {
147
widget.after("contentUpdate", function() {
148
Y.log("Content Updated");
151
widget2 = new Y.Overlay({
152
contentBox: "#fromMarkup",
156
footerContent: "Footer Content - was in markup, but got over-ridden in constructor",
160
var stepDelay = 2000;
164
widget.set("height", "20em");
167
widget.set("bodyContent", "Height changed to 20em in previous step");
171
widget.set("bodyContent", "move(0,0)");
174
widget.set("height", "12em");
175
widget.set("bodyContent", "height, 12em");
178
widget.set("align", {node:"#align", points:["lc", "rc"]});
179
widget.set("bodyContent", "#align, lc, rc");
182
widget.set("centered", "#align");
183
widget.set("bodyContent", "#align, centered");
186
widget.set("zIndex", 7);
187
widget.set("bodyContent", "zIndex, 7");
190
widget.set("align", {points:["rc", "rc"]});
191
widget.set("bodyContent", "viewport, rc, rc");
194
widget.set("centered", true);
195
widget.set("bodyContent", "viewport, centered");
199
widget.set("bodyContent", "move(0,0)");
202
widget.set("width", "20em");
203
widget.set("bodyContent", "width, 20em");
206
widget.set("fillHeight", "header");
207
widget.set("bodyContent", "fillHeight, header");
210
widget.set("fillHeight", "footer");
211
widget.set("bodyContent", "fillHeight, footer");
214
widget.set("fillHeight", null);
215
widget.set("bodyContent", "fillHeight, false");
218
widget.set("fillHeight", "body");
219
widget.set("bodyContent", "fillHeight, body");
222
widget.set("shim", false);
223
widget.set("bodyContent", "shim, false");
226
widget.set("shim", true);
227
widget.set("bodyContent", "shim, true");
234
widget.set("bodyContent", "hide, followed by show");
237
widget.setStdModContent(Y.WidgetStdMod.FOOTER, null);
240
widget.setStdModContent(Y.WidgetStdMod.HEADER, Y.Node.create("<p>Insert Before Header Content</p>"), Y.WidgetStdMod.BEFORE);
241
widget.setStdModContent(Y.WidgetStdMod.FOOTER, Y.Node.create("<p>Append After Footer Content</p>"), Y.WidgetStdMod.AFTER);
242
widget.setStdModContent(Y.WidgetStdMod.BODY, "Replaced Body - DONE!", Y.WidgetStdMod.REPLACE);
249
var q = new Y.AsyncQueue();
250
for (var i = 0; i < fns.length; i++){
258
Y.on('click', Y.bind(widget.show, widget), Y.Node.one('#control-show'));
259
Y.on('click', Y.bind(widget.hide, widget), Y.Node.one('#control-hide'));
260
Y.on('click', Y.bind(q.run, q), Y.Node.one('#control-run'));