I'm using OnsenUI tabs, how can I make it so the user automatically starts in my home screen, and not in my last tab?



  • I have googled it but can’t find anything.

    this is the screen I want to be my home screen:
    <ons-template id=“tab3.html”>
    <ons-page>
    <ons-toolbar>
    <div class=“center”>Hoofdscherm</div>
    </ons-toolbar>
    <p style=“text-align: center;”>
    <img src=“Crosspoint.png” alt=“crosspoint logo”
    style=“width:505px;height:159px;” style=“clear:both”>
    </p>
    <p style=“text-align: center;”>
    Welkom bij de kerstwandeling van
    CrossPoint, kerk in Getsewoud.

    </p>
    

    </ons-page>
    </ons-template>

    this is the screen that automatically starts now:
    <p style=“text-align: center;”>
    tab 5
    </p>
    </ons-page>
    </ons-template>
    </body>
    </html>

    I can’t find anything in this code that would help me, do any of you know what I can do?



  • @bollejoost Just use the active attribute:

    https://onsen.io/v2/docs/js/ons-tabbar.html

    <ons-tabbar>
      <ons-tab label="Tab 1" page="tab1.html" active>
      </ons-tab>
      <ons-tab label="Tab 2" page="tab2.html">
      </ons-tab>
    </ons-tabbar>
    

Log in to reply