Created
December 14, 2015 08:04
-
-
Save masayuki5160/040c206c5af15dbba3c2 to your computer and use it in GitHub Desktop.
動的に追加をしたときはコンポーネントの再コンパイルが必要になる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
動的にOnsenUIのコンポーネントを追加したいとき | |
//メニュー画面に遷移するボタンを表示させる | |
var btn = $("<ons-button onclick='quizNavi.resetToPage(\"menu.html\")'>メニューに戻る</ons-button>"); | |
btn.appendTo($("#question")); | |
ons.compile(btn[0]); | |
参考:OnsenUIの要素をJavaScriptで動的に表示する場合 | |
http://mb.cloud.nifty.com/doc/current/tutorial/monaca_quiz_02.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment