本文介绍了jQuery Mobile标题按钮左右浮动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使标题在左右两侧具有两组按钮,但是我在使所有内容对齐并正确地左右浮动时遇到了麻烦.关于实现此目标的简单方法的任何想法.

i'm trying to get the header to have two sets of button on the left and right, but i'm having trouble getting everything to line up and float left/right properly. Any idea on an easy way to accomplish this.

     <div data-theme="a" data-role="header" data-position="fixed">
<!-- back button -->                    
       <a style=" margin:5px 0 10px 0;" data-role="button" 
    data-transition="slide" data-theme="b" href="#track_dash" 
    data-icon="arrow-l" data-iconpos="left">
          Back
       </a>

<!-- chart switch -->                    
            <div data-role="fieldcontain" style="float: right;">
                <form action="#" method="POST">
                    <fieldset data-role="controlgroup" data-type="horizontal" >
                       <input name="radiobuttons5" id="radio7" value="radio1" type="radio" />
                       <label for="radio7">
                            List
                       </label>
                       <input name="radiobuttons5" id="radio8" value="radio8" type="radio" />
                       <label for="radio8">
                            Chart
                       </label>
                    </fieldset>
                </form>
            </div>

      </div>  

推荐答案

在后退按钮上使用class="ui-btn-left,在对照组上使用class="ui-btn-right".

Use class="ui-btn-left on the back button and class="ui-btn-right" on the controlgroup.

也许您还需要在两个元素之间放置一个标题,至少为空<h1></h1>

Maybe you also need to put a header between both elements, at least empty <h1></h1>

这篇关于jQuery Mobile标题按钮左右浮动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 14:45