質問編集履歴

1

コードの追加

2017/05/13 11:29

投稿

rock_
rock_

スコア12

test CHANGED
File without changes
test CHANGED
@@ -14,15 +14,81 @@
14
14
 
15
15
  ###分からないこと
16
16
 
17
- 定義の仕方や実装方法がわからず困っています。
18
-
19
- ・背景色を左から右にフェードして消す
20
-
21
- ・その後テキストを左から順に表示させる
22
-
23
- 以上2点の定義参考サイにアニメーションできるのでしょうか...?
17
+ cssw0から.boxサイwidthにアニメーションしているので内包ているテキストも同じ様にアニメーションしてしまいます。
24
18
 
25
19
 
20
+
21
+ ・背景色を左から右にフェードして消したい
22
+
23
+ ・その後テキストを左から順に表示させたいです。
24
+
25
+
26
+
27
+ ```html
28
+
29
+ <div class="box">
30
+
31
+ <div class="bg">
32
+
33
+ <div class="text">テキストテキストテキスト</div>
34
+
35
+ </div>
36
+
37
+ </div>
38
+
39
+ ```
40
+
41
+
42
+
43
+ ```css
44
+
45
+ .box {
46
+
47
+ position: relative;
48
+
49
+ width: 500px;
50
+
51
+ }
52
+
53
+
54
+
55
+ .bg {
56
+
57
+ position: absolute;
58
+
59
+ top: 100px;
60
+
61
+ left: 0;
62
+
63
+ width: 0;
64
+
65
+ height: 20px;
66
+
67
+ background: #E74C3C;
68
+
69
+ }
70
+
71
+ ```
72
+
73
+
74
+
75
+ ```jquery
76
+
77
+ $(function() {
78
+
79
+ boxW = $(".box").width();
80
+
81
+ spped = 3000;
82
+
83
+ $('.bg').animate({
84
+
85
+ width: boxW
86
+
87
+ }, spped);
88
+
89
+ });
90
+
91
+ ```
26
92
 
27
93
 
28
94