source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/anim/anim-chaining_clean.html @ 5259

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/anim/anim-chaining_clean.html@5259
Revision 5259, 2.3 KB checked in by domlowe, 11 years ago (diff)

adding yui javascript

Line 
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>Chaining Animations Using the <code>end</code> 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. */
13body {
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>Chaining Animations Using the <code>end</code> Event</h1>
33
34<div class="exampleIntro">
35        <p>This demonstrates how to use the <code>end</code> event to chain animations runs together.</p>
36<p> Click the X in the header to fade the element out, then shrink its height to zero.</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">
56YUI({base:"../../build/", timeout: 10000}).use("anim-base", "anim-easing", function(Y) {
57    var anim = new Y.Anim({
58        node: '#demo',
59        to: { opacity: 0 }
60    });
61
62    var onEnd = function() {
63        this.unsubscribe('end', onEnd);
64        this.setAtts({
65            to: { height: 0 },
66            easing: Y.Easing.bounceOut
67        });
68        this.run();
69    };
70
71    anim.on('end', onEnd);
72
73    Y.get('#demo .yui-remove').on('click', anim.run, anim);
74
75});
76
77</script>
78
79<!--END SOURCE CODE FOR EXAMPLE =============================== -->
80
81</body>
82</html>
83<!-- delightfuture.corp.yahoo.com uncompressed/chunked Wed Aug 13 16:45:30 PDT 2008 -->
Note: See TracBrowser for help on using the repository browser.