以下のとおりSampleベースで書いたのですが、tabbarとslidemenuが競合しているのかどっちかしか動きません。両方成立させるためにはどうするべきでしょうか?ちなみにしたのコードだとtabbarしか動きません。
<!DOCTYPE HTML> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <link rel="stylesheet" href="components/loader.css"> <link rel="stylesheet" href="css/style.css"> <script src="components/loader.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script>ons.bootstrap();</script> </head> <body> <ons-tabbar> <ons-tab page="home.html" label="Home" icon="ion-home" active="true"></ons-tab> <ons-tab page="comments.html" label="Comments" icon="ion-chatbox-working"></ons-tab> <ons-tab page="tags.html" label="Tags" icon="ion-ios-pricetag"></ons-tab> <ons-tab page="settings.html" label="Settings" icon="ion-ios-cog"></ons-tab> </ons-tabbar><ons-template id="page1.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">page1</div> </ons-toolbar> <p style="text-align: center; color: #999; padding-top: 100px;">page1 Contents</p> </ons-page> </ons-template><ons-sliding-menu main-page="index.html" menu-page="menu.html" side="left" max-slide-distance="250px" var="menu"> </ons-sliding-menu> <ons-template id="home.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Home</div> </ons-toolbar> <p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p> </ons-page> </ons-template> <ons-template id="comments.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Comments</div> </ons-toolbar> <p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p> </ons-page> </ons-template> <ons-template id="tags.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Tags</div> </ons-toolbar> <p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p> </ons-page> </ons-template> <ons-template id="feed.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Feed</div> </ons-toolbar> <p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p> </ons-page> </ons-template> <ons-template id="settings.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Settings</div> </ons-toolbar> <p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p> </ons-page> </ons-template>
</body> </html><ons-template id="page2.html"> <ons-page> <ons-toolbar> <div class="left"> <ons-toolbar-button onclick="menu.toggleMenu()"> <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon> </ons-toolbar-button> </div> <div class="center">Page 2</div> </ons-toolbar> <p style="text-align: center; color: #999; padding-top: 100px;">Page2 Contents</p> </ons-page> </ons-template> <ons-template id="menu.html"> <ons-list><ons-list-item modifier="chevron" onclick="menu.setMainPage('page1.html', {closeMenu: true})">page1.html</ons-list-item> <ons-list-item modifier="chevron" onclick="menu.setMainPage('page2.html', {closeMenu: true})">page2.html</ons-list-item> </ons-list> </ons-template>
あなたの回答
tips
プレビュー