teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

8

文の修正

2017/12/13 00:58

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -1,4 +1,4 @@
1
- いろいろと試行錯誤して弄ってみた結果、特定の項目だけにアニメーションをつけることができました!
1
+ いろいろと試行錯誤して弄ってみた結果、特定の項目だけにアニメーションをつけて遷移させることができました!
2
2
  **[こちらのページ](https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/)**が大変参考になりました。
3
3
  ```
4
4
  <script>

7

間違い修正

2017/12/13 00:58

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -23,10 +23,6 @@
23
23
  content.pushPage(page, data);
24
24
  menu.close();
25
25
  };
26
- window.fn.pop = function() { // アニメーション付きのページからpopする
27
- var content = document.getElementById('menu-navi');
28
- content.popPage();
29
- };
30
26
  </script>
31
27
  ```
32
28
  ```html

6

読みやすいように改訂

2017/12/10 18:23

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -1,9 +1,5 @@
1
- 特定の項目のみではなく、メニュー内の項目すべてであるものの、アニメーションをつけることができました
1
+ いろいろと試行錯誤して弄ってみた結果、特定の項目だけにアニメーションをつけることができました
2
2
  **[こちらのページ](https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/)**が大変参考になりました。
3
-
4
- ---
5
- 追記です。
6
- いろいろと試行錯誤して弄ってみた結果、特定の項目だけにアニメーションをつけることができました!
7
3
  ```
8
4
  <script>
9
5
  ons.ready(function() {

5

誤字

2017/12/10 17:37

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -16,7 +16,7 @@
16
16
  menu.open();
17
17
  };
18
18
  window.fn.load = function(page) { // 今まで通り読み込む
19
- var menu = document.getElementById('menu-navi');
19
+ var content = document.getElementById('menu-navi');
20
20
  var navi = document.getElementById('menu-navi');
21
21
  navi.resetToPage(page)
22
22
  .then(menu.close(menu));

4

誤字編集

2017/12/10 17:34

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  ---
5
5
  追記です。
6
- いろいろと弄ってみると、特定の項目だけにアニメーションをつけることができました!
6
+ いろいろと試行錯誤して弄ってみた結果、特定の項目だけにアニメーションをつけることができました!
7
7
  ```
8
8
  <script>
9
9
  ons.ready(function() {

3

最終結果

2017/12/10 07:41

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -1,2 +1,62 @@
1
1
  特定の項目のみではなく、メニュー内の項目すべてであるものの、アニメーションをつけることができました。
2
- [こちらのページ](https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/)が大変参考になりました。
2
+ **[こちらのページ](https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/)**が大変参考になりました。
3
+
4
+ ---
5
+ 追記です。
6
+ いろいろと弄ってみると、特定の項目だけにアニメーションをつけることができました!
7
+ ```
8
+ <script>
9
+ ons.ready(function() {
10
+ console.log("Onsen UI is ready!");
11
+ });
12
+
13
+ window.fn = {};
14
+ window.fn.open = function() {
15
+ var menu = document.getElementById('menu');
16
+ menu.open();
17
+ };
18
+ window.fn.load = function(page) { // 今まで通り読み込む
19
+ var menu = document.getElementById('menu-navi');
20
+ var navi = document.getElementById('menu-navi');
21
+ navi.resetToPage(page)
22
+ .then(menu.close(menu));
23
+ };
24
+ window.fn.push = function(page, data) { // アニメーションを付ける
25
+ var content = document.getElementById('menu-navi');
26
+ var menu = document.getElementById('menu');
27
+ content.pushPage(page, data);
28
+ menu.close();
29
+ };
30
+ window.fn.pop = function() { // アニメーション付きのページからpopする
31
+ var content = document.getElementById('menu-navi');
32
+ content.popPage();
33
+ };
34
+ </script>
35
+ ```
36
+ ```html
37
+ <body>
38
+ <ons-splitter>
39
+ <ons-splitter-side id="menu" side="left" width="220px" swipe-target-width="100px" collapse swipeable>
40
+ <ons-page id="menuPage">
41
+ <ons-list>
42
+ <ons-list-item onclick="fn.load('home.html')" tappable>
43
+ トップページ
44
+ </ons-list-item>
45
+ <ons-list-item onclick="fn.push('settings.html')" id="menu-settings" tappable>
46
+ 設定
47
+ </ons-list-item>
48
+ <ons-list-item onclick="fn.push('tips.html')" style="position:absolute; bottom:50px;" tappable>
49
+ その他
50
+ </ons-list-item>
51
+ </ons-list>
52
+ </ons-page>
53
+ </ons-splitter-side>
54
+ <ons-splitter-content id="content" page="homePage.html"></ons-splitter-content>
55
+ </ons-splitter>
56
+
57
+ <ons-template id="homePage.html">
58
+ <ons-page id="homePage">
59
+ <ons-navigator id="menu-navi" animation="slide" page="home.html"></ons-navigator>
60
+ </ons-page>
61
+ </ons-template>
62
+ ```

2

リンク

2017/12/10 07:39

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -1,4 +1,2 @@
1
1
  特定の項目のみではなく、メニュー内の項目すべてであるものの、アニメーションをつけることができました。
2
-
3
- こちらのページが大変参考になりました。
4
- https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/
2
+ [こちらのページ](https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/)が大変参考になりました。

1

リンク

2017/12/08 10:32

投稿

hagana
hagana

スコア8

answer CHANGED
@@ -1,4 +1,4 @@
1
1
  特定の項目のみではなく、メニュー内の項目すべてであるものの、アニメーションをつけることができました。
2
2
 
3
3
  こちらのページが大変参考になりました。
4
- https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/2
4
+ https://community.onsen.io/topic/589/using-a-splitter-menu-with-a-navigator-example-inside/