回答編集履歴
4
追記しました。
answer
CHANGED
@@ -18,4 +18,31 @@
|
|
18
18
|
opacity: [ 0, 1 ],
|
19
19
|
color: [ "#fff", "#fff" ]
|
20
20
|
}, 2000);
|
21
|
+
```
|
22
|
+
|
23
|
+
---
|
24
|
+
追記:
|
25
|
+
jQueryを使っているなら、以下のようなつくりでいかがでしょうか?
|
26
|
+
|
27
|
+
```JS
|
28
|
+
new Vivus(
|
29
|
+
"title-path",
|
30
|
+
{
|
31
|
+
type: "scenario-sync",
|
32
|
+
duration: 20,
|
33
|
+
forceRender: false,
|
34
|
+
animTimingFunction: Vivus.EASE
|
35
|
+
},
|
36
|
+
function () {
|
37
|
+
// 色は共通なので1箇所で指定。できればCSSに記述。
|
38
|
+
$("path").css({
|
39
|
+
fill: "white"
|
40
|
+
});
|
41
|
+
|
42
|
+
// 変化があるopacityだけ、jQueryのanimate()で変化させる
|
43
|
+
$("path").animate({
|
44
|
+
opacity: 1
|
45
|
+
}, 2000);
|
46
|
+
}
|
47
|
+
);
|
21
48
|
```
|
3
修正
answer
CHANGED
@@ -7,4 +7,15 @@
|
|
7
7
|
すみません、JavaScriptの仕様としてあるようですね..
|
8
8
|
[https://developer.mozilla.org/ja/docs/Web/API/Element/animate](https://developer.mozilla.org/ja/docs/Web/API/Element/animate)
|
9
9
|
|
10
|
-
ただ「実験的な機能」ではあるようです。
|
10
|
+
ただ「実験的な機能」ではあるようです。
|
11
|
+
|
12
|
+
---
|
13
|
+
追記:
|
14
|
+
「getElementsByTagName」で取得しているため、以下のように記述する必要があるのではないかと思います。
|
15
|
+
```JS
|
16
|
+
// 配列「element[0]」などで取得
|
17
|
+
element[0].animate({
|
18
|
+
opacity: [ 0, 1 ],
|
19
|
+
color: [ "#fff", "#fff" ]
|
20
|
+
}, 2000);
|
21
|
+
```
|
2
修正
answer
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
~~animate()はjQueryの関数ではないですか? 調べてみたほうがよさそうに思えます。~~
|
2
2
|
|
3
3
|
~~参考URL: ~~
|
4
|
-
|
4
|
+
~~http://semooh.jp/jquery/api/effects/animate/params,+[duration],+[easing],+[callback]/~~
|
5
5
|
|
6
6
|
---
|
7
7
|
すみません、JavaScriptの仕様としてあるようですね..
|
1
訂正
answer
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
animate()はjQueryの関数ではないですか? 調べてみたほうがよさそうに思えます。
|
1
|
+
~~animate()はjQueryの関数ではないですか? 調べてみたほうがよさそうに思えます。~~
|
2
2
|
|
3
|
-
参考URL:
|
3
|
+
~~参考URL: ~~
|
4
|
-
[http://semooh.jp/jquery/api/effects/animate/params,+[duration],+[easing],+[callback]/](http://semooh.jp/jquery/api/effects/animate/params,+[duration],+[easing],+[callback]/)
|
4
|
+
[http://semooh.jp/jquery/api/effects/animate/params,+[duration],+[easing],+[callback]/](~~http://semooh.jp/jquery/api/effects/animate/params,+[duration],+[easing],+[callback]/~~)
|
5
|
+
|
6
|
+
---
|
7
|
+
すみません、JavaScriptの仕様としてあるようですね..
|
8
|
+
[https://developer.mozilla.org/ja/docs/Web/API/Element/animate](https://developer.mozilla.org/ja/docs/Web/API/Element/animate)
|
9
|
+
|
10
|
+
ただ「実験的な機能」ではあるようです。
|