anim.html revision e26236e4ee3c1c1cfed2f2c245cc9f2a8c7d4753
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style>
html, body {
padding:0;
margin:0;
}
.yui-overlay-content {
background-color:#ccc;
border:1px solid green;
}
</style>
</head>
<body>
<script src="/build/yui/yui.js"></script>
<script src="/build/widget-anim/widget-anim.js"></script>
<button id="btn" type="button">Toggle</button>
<script>
YUI({filter:"raw"}).use("anim", "widget-anim", "overlay", function(Y) {
var o = new Y.Overlay({
visible:true,
height:"200px",
width:"200px",
xy: [100,100],
bodyContent:"Body",
headerContent:"Header",
footerContent:"Footer",
render:"#constraint"
});
o.plug(Y.Plugin.WidgetAnim);
Y.Node.one("#btn").on("click", function() {
o.set("visible", !o.get("visible"));
});
});
</script>
</body>
</html>