###前提・実現したいこと
初心者です。monacaを使ってハイブリッドアプリを製作しています。
onsenUIのons-navigatorコンポーネントを使って画面遷移をしたいのですが、
上手くいきません。
例えば、ons-list-itemからプライバシー設定のページに遷移させたいとすると、
以下のようにすれば良いかと思うのですが、タップ可能な状態になりません。
初歩的な質問かと思いますが、原因を教えていただければ幸いです。
よろしくお願いいたします。
<ons-list-item modifier="chevron" onclick="myNavigator.pushPage('privacy_configration.html');">プライバシー設定</ons-list-item>
###該当のソースコード
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"> <script src="components/loader.js"></script> <script src="lib/onsenui/js/onsenui.min.js"></script> <link rel="stylesheet" href="components/loader.css"> <link rel="stylesheet" href="lib/onsenui/css/onsenui.css"> <link rel="stylesheet" href="lib/onsenui/css/onsen-css-components.css"> <link rel="stylesheet" href="css/style.css"> <script> ons.ready(function() { console.log("Onsen UI is ready!"); }); document.addEventListener('show', function(event) { var page = event.target; var titleElement = document.querySelector('#toolbar-title'); if (page.matches('#first-page')) { titleElement.innerHTML = '検索する'; } else if (page.matches('#second-page')) { titleElement.innerHTML = 'プロフィールを設定する'; } else if (page.matches('#third-page')) { titleElement.innerHTML = 'メッセージを確認する'; } else if (page.matches('#forth-page')) { titleElement.innerHTML = 'その他'; } }); </script> </head> <body> <ons-navigator var="myNavigator" page="tab1.html"> <ons-page> <ons-toolbar> <div class="center" id="toolbar-title"></div> </ons-toolbar> <ons-tabbar position="auto"> <ons-tab label="検索" icon="fa-search" page="tab1.html"> </ons-tab> <ons-tab label="プロフィール設定" icon="fa-user" page="tab2.html"> </ons-tab> <ons-tab label="メッセージ" icon="fa-envelope-o" page="tab3.html"> </ons-tab> <ons-tab label="その他" icon="fa-ellipsis-h" page="tab4.html" active> </ons-tab> </ons-tabbar> </ons-page> <ons-template id="tab1.html"> <ons-page id="first-page"> <p style="text-align: center;"> This is the first page. </p> </ons-page> </ons-template> <ons-template id="tab2.html"> <ons-page id="second-page"> <p style="text-align: center;"> This is the second page. </p> </ons-page> </ons-template> <ons-template id="tab3.html"> <ons-page id="third-page"> <p style="text-align: center;"> This is the third page. </p> </ons-page> </ons-template> <ons-template id="tab4.html"> <ons-page id="forth-page"> <p style="text-align: center;"> <ons-list> <ons-list-item modifier="chevron" onclick="myNavigator.pushPage('privacy_configration.html');">プライバシー設定</ons-list-item> <ons-list-item modifier="chevron">利用規約</ons-list-item> <ons-list-item modifier="chevron">プライバシーポリシー</ons-list-item> <ons-list-item modifier="chevron">お問い合わせ</ons-list-item> <ons-list-item modifier="chevron">ヘルプ</ons-list-item></ons-template> <ons-template id="privacy_configration.html"> <ons-page id="fifth-page"> <p style="text-align: center;"> <p>テキストテキストテキストテキスト</p> </p> </ons-page> </ons-template> </ons-navigator> </body> </html> ```</ons-list> </p> </ons-page>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/07 12:18
2017/04/07 12:42
2017/04/07 12:47
2017/04/07 12:53 編集
2017/04/07 17:06