-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfn.fadeIn.html
76 lines (72 loc) · 2.82 KB
/
fn.fadeIn.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>avalon.fn.fadeIn</title>
<style type="text/css">
#sample{
border:1px solid red;
height: 80px;
}
#sample div{ margin:3px; width:80px;
height:80px; float:left;display: none; }
div#one { background:#f00; }
div#two { background:#0f0; }
div#three { background:#00f; }
</style>
<script src="avalon.js"></script>
<script>
require(["mmAnimate"], function(avalon) {
avalon.define("fx", function(vm) {
vm.effect = function() {
for (var i = 0, el; el = this.children[i++]; ) {
avalon(el).fadeIn(1000)
}
}
})
avalon.scan()
})
</script>
</head>
<body>
<article>
<h3>avalon.fn.fadeIn(duration, props)</h3>
<p><span class="stress">描述:</span></p>
<p>让匹配的每个节点进行淡入动画。</p>
<p><span class="stress">参数:</span></p>
<dl>
<dt>duration</dt>
<dd>可选。Number。动画执行时间,单位为ms,默认为500ms。</dd>
<dd>可选。Function。动画结束时的回调函数</dd>
<dt>props</dt>
<dd>可选。Object。各种配置。</dd>
</dl>
<p><span class="stress">返回值:</span></p>
<p>avalon实例</p>
<p>props配置对象可以指定各种CSS属性,如width, height, color, fontSize, opacity等进行动画变化,
还支持scrollTop与scrollLeft这两个属性进行动画变化。还可以指定动画开始前的回调函数before,动画结束时的回调函数after,
动画是否进行倒带revert....
</p>
<fieldset ><legend>例子</legend>
<pre class="brush:javascript;gutter:false;toolbar:false">
require(["mmAnimate"], function(avalon) {
avalon.define("fx", function(vm) {
vm.effect = function() {
for (var i = 0, el; el = this.children[i++]; ) {
avalon(el).fadeIn(1000)
}
}
})
avalon.scan()
})
</pre>
<div id="sample" ms-controller="fx" ms-click="effect">
<div id="one"></div>
<div id="two" ></div>
<div id="three" ></div>
点我
</div>
</fieldset>
</article>
</body>
</html>