-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontAnimation.html
65 lines (57 loc) · 1.5 KB
/
fontAnimation.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.con7_center{
width: 500px;
margin: 100px auto;
}
.con7_center span{
display: block;
height: 50px;
line-height: 50px;
text-align: center;
font-size: 16px;
color: hotpink;
}
</style>
<script src="jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="con7_center">
<span>实训项目代码超过4万行</span>
<span>相当于2年以上工程师经验</span>
<span>覆盖15个大型企业级项目</span>
<span>8大热门行业</span>
<span>讲师全程手把手教授</span>
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
var n = 0;
var timer = setInterval(function(){
if(n == 0){
$(".con7_center").find("span").eq($(".con7_center").find("span").size()-1).animate({"font-size": "16px"}, 700, "swing");
$(".con7_center").find("span").eq(n).animate({"font-size": "30px"}, 700, "swing", function(){
n++;
});
}else if(n >0 && n < $(".con7_center").find("span").size()){
$(".con7_center").find("span").eq(n-1).animate({"font-size": "16px"}, 700, "swing");
$(".con7_center").find("span").eq(n).animate({"font-size": "30px"}, 700, "swing", function(){
if(n >= $(".con7_center").find("span").size()-1){
n=0;
}else{
n++;
}
});
}
},1500);
})
</script>