File: tween_test.html

package info (click to toggle)
scriptaculous 1.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 888 kB
  • ctags: 158
  • sloc: makefile: 22
file content (38 lines) | stat: -rw-r--r-- 1,226 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>script.aculo.us Effects functional test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="../../lib/prototype.js" type="text/javascript"></script>
  <script src="../../src/scriptaculous.js" type="text/javascript"></script>
  <script src="../../src/unittest.js" type="text/javascript"></script>
<body>
<h1>script.aculo.us Effects functional test file</h1>

<p id="foo">test</p>

<div style="height:2000px">...</div>
      
<script type="text/javascript">


  $('foo').setBar = function(p){
    this.setStyle('font-size: '+p+'px');
  };
  new Effect.Tween('foo', 10, 50, { duration: 4.0 }, 'setBar');
  new Effect.Tween('foo', 10, 20, 'innerHTML');
  new Effect.Tween('foo', 50, 0, {duration: 2.0}, function(p){
    this.setStyle({border:p.toFixed(3)+'px solid red'});
  });
  
  
  new Effect.Tween(null, 0, 100, function(p){ scrollTo(0,p) });
  
  //new Effect.Tween(window, function(p){
  //  this.scrollTo(0,p);
  //}, $R(0,100))
</script>    

</body>
</html>