source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/anim/alt-iterations_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/alt-iterations_clean.html@5259
Revision 5259, 2.4 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>Alternating Iterations</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>Alternating Iterations</h1>
33
34<div class="exampleIntro">
35        <p>This demonstrates how to use the <code>iterations</code> attribute to run multiple iterations of the animation.</p>
36<p>Mouse over the link to begin the animation.</p>
37
38                       
39</div>
40
41<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
42
43   
44<a href="#" id="demo">hover me</a>
45<script type="text/javascript">
46YUI({base:"../../build/", timeout: 10000}).use("anim-color", function(Y) {
47    var node = Y.get('#demo');
48
49    var anim = new Y.Anim({
50        node: node,
51        from: {
52            backgroundColor:node.getStyle('backgroundColor'),
53            color: node.getStyle('color'),
54            borderColor: node.getStyle('borderTopColor')
55        },
56
57        to: {
58            color: '#fff',
59            backgroundColor:'#ffa928',
60            borderColor: '#71241a'
61        },
62
63        duration: 0.5,
64        iterations: 'infinite',
65        direction: 'alternate'
66    });
67
68    var hover = function(e) {
69        var reverse = false,
70            iterations = 'infinite';
71
72        if (anim.get('running')) {
73            anim.pause();
74        }
75        if (e.type === 'mouseout') {
76            reverse = true;
77            iterations = 1;
78        }
79        anim.setAtts({
80            'reverse': reverse,
81            'iterations': iterations
82        });
83
84        anim.run();
85    };
86
87    node.on('mouseover', hover);
88    node.on('mouseout', hover);
89});
90
91</script>
92
93<!--END SOURCE CODE FOR EXAMPLE =============================== -->
94
95</body>
96</html>
97<!-- delightfuture.corp.yahoo.com uncompressed/chunked Wed Aug 13 16:45:29 PDT 2008 -->
Note: See TracBrowser for help on using the repository browser.