jQuery Mobile best practice - panel button, back button, or both [closed]

陌路散爱 提交于 2019-12-11 23:23:31

问题


I'm creating a mobile app targeted for iPad Mini. I have a panel that slides out from the left with navigation menu. I also have the need for a back button in the header. What is the best practice for buttons in the header? I need a back button at certain times in the flow of the application and I also need the button that opens the panel in the header too.

Thanks for your advice.

I forgot to mention the right side of header has a button that loads barcode scanner. So, I'm left with left side of header to compete for 2 buttons.


回答1:


Header can accommodate two buttons on right and left, ui-btn-left and ui-btn-right respectively.

However, you can place more than two buttons in header by using controlgroup widget with data-type="horizontal" attribute.

<div data-role="header">
    <!-- right-hand button -->
    <a href="#" class="ui-btn-right" data-icon="bars">Bcode</a>

    <!-- if you don't want to use title,
    replace it with <span class="ui-title"></span> -->
    <h1>Header</h1>

    <!-- left-hand button -->
    <div data-role="controlgroup" data-type="horizontal" class="ui-btn-left">
        <a href="#panel" data-role="button" data-icon="star">Panel</a>
        <a href="#" data-role="button" data-icon="back">Back</a>
    </div>
</div>

Demo jQM <= 1.3

Demo jQM >= 1.4



来源:https://stackoverflow.com/questions/20402920/jquery-mobile-best-practice-panel-button-back-button-or-both

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!