1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
---|
5 | <title>Using the End Event</title> |
---|
6 | |
---|
7 | <style type="text/css"> |
---|
8 | /*margin and padding on body element |
---|
9 | can introduce errors in determining |
---|
10 | element position and are not recommended; |
---|
11 | we turn them off as a foundation for YUI |
---|
12 | CSS treatments. */ |
---|
13 | body { |
---|
14 | margin:0; |
---|
15 | padding:0; |
---|
16 | } |
---|
17 | </style> |
---|
18 | |
---|
19 | <link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" /> |
---|
20 | <script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
---|
21 | |
---|
22 | |
---|
23 | <!--begin custom header content for this example--> |
---|
24 | <link href="assets//anim.css" rel="stylesheet" type="text/css"> |
---|
25 | |
---|
26 | <!--end custom header content for this example--> |
---|
27 | |
---|
28 | </head> |
---|
29 | |
---|
30 | <body class=" yui-skin-sam"> |
---|
31 | |
---|
32 | <h1>Using the End Event</h1> |
---|
33 | |
---|
34 | <div class="exampleIntro"> |
---|
35 | <p>This demonstrates how to use the <code>end</code> event.</p> |
---|
36 | <p> Click the X in the header to fade the element out and remove it from the document once the fade completes.</p> |
---|
37 | |
---|
38 | |
---|
39 | </div> |
---|
40 | |
---|
41 | <!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --> |
---|
42 | |
---|
43 | |
---|
44 | <div id="demo" class="yui-module"> |
---|
45 | <div class="yui-hd"> |
---|
46 | <h4>Animation Demo</h4> |
---|
47 | <a title="remove module" class="yui-remove"><em>x</em></a> |
---|
48 | </div> |
---|
49 | <div class="yui-bd"> |
---|
50 | <p>This an example of what you can do with the YUI Animation Utility.</p> |
---|
51 | <p><em>Follow the instructions above to see the animation in action.</em></p> |
---|
52 | </div> |
---|
53 | </div> |
---|
54 | <p>This is placeholder text used to demonstrate how the above animation affects subsequent content.</p> |
---|
55 | <script type="text/javascript"> |
---|
56 | YUI({base:"../../build/", timeout: 10000}).use("anim-base", function(Y) { |
---|
57 | var anim = new Y.Anim({ |
---|
58 | node: '#demo', |
---|
59 | to: { opacity: 0 } |
---|
60 | }); |
---|
61 | |
---|
62 | var onEnd = function() { |
---|
63 | var node = this.get('node'); |
---|
64 | node.get('parentNode').removeChild(node); |
---|
65 | }; |
---|
66 | |
---|
67 | anim.on('end', onEnd); |
---|
68 | |
---|
69 | Y.get('#demo .yui-remove').on('click', anim.run, anim); |
---|
70 | |
---|
71 | }); |
---|
72 | |
---|
73 | </script> |
---|
74 | |
---|
75 | <!--END SOURCE CODE FOR EXAMPLE =============================== --> |
---|
76 | |
---|
77 | </body> |
---|
78 | </html> |
---|
79 | <!-- delightfuture.corp.yahoo.com uncompressed/chunked Wed Aug 13 16:45:30 PDT 2008 --> |
---|