-
Notifications
You must be signed in to change notification settings - Fork 23
/
to-from-auto.html
59 lines (46 loc) · 1.27 KB
/
to-from-auto.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>tram.js example</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="../support/styles/example.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../node_modules/jquery/dist/jquery.min.js"><\/script>')</script>
<script src="../dist/tram.js"></script>
<style type="text/css">
.test1 { overflow: hidden; width: 200px; }
.stuff { padding: 30px 20px; }
</style>
</head>
<body>
<p>
Transition pixels -> 'auto'.
</p>
<div class="test test1">
<div class="stuff">stuff n things</div>
</div>
<script>
var test = $('.test1');
test.height(0);
tram(test)
.add('height 500ms ease')
.start({ height: 'auto' })
.then(function () {
this.set({ height: 'auto' });
});
</script>
<p>
Transition 'auto' -> pixels.
</p>
<div class="test test2"></div>
<script>
var test2 = $('.test2');
test2.width('auto');
tram(test2)
.add('width 1s ease')
.start({ width: 0 });
</script>
</body>
</html>