html - 在 JQuery Mobile 中用按钮填充整个内容区域

标签 html css jquery-mobile

我正在使用 JQuery Mobile 创建一个包含页眉、内容和页脚区域的页面。整个内容区域必须分成两个部分,每个部分 50%,其中每个部分必须是一个按钮,没有任何圆 Angular 或间距,可以根据所使用的设备和设备的布局(纵向或景观)。我尝试了几种方法,例如 data-role="controlgroup"data-type="horizo​​ntal" 但它似乎没有提供我想要的.有人可以首先告诉我是否可行,如果可行,应该使用哪些元素和属性?提前致谢!

最佳答案

这是一个工作示例:http://jsfiddle.net/Gajotres/TfzPw/

此解决方案需要:

  1. jQuery Mobile 网格(Omar 在他的评论中提到了它)

    <div class="ui-grid-a">
        <div class="ui-block-a"><a data-role="button" id="custom-btn">Button Left</a></div>
        <div class="ui-block-b"><a data-role="button" id="custom-btn">Button Right</a></div>
    </div><!-- /grid-a -->
    

    官方文档:http://jquerymobile.com/demos/1.3.0-rc.1/docs/content/content-grids.html

  2. 移除圆 Angular :

    $(document).on('pagebeforeshow', '#index', function(){       
        $('a').buttonMarkup({ corners: false });
    });
    

    官方文档:http://jquerymobile.com/demos/1.3.0-rc.1/docs/buttons/buttons-options.html

  3. 删除内容 div 上的填充:

    #index-content {
        padding: 0 !important;
    }
    
  4. 移除按钮边距:

    #custom-btn {
        margin: 0 !important;
    }
    

关于html - 在 JQuery Mobile 中用按钮填充整个内容区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15348569/

相关文章:

javascript - 附加列表切换 (jQuery Mobile) 未正确呈现

javascript - JqueryMobile加载图标不一致

php - 插入带有 php 代码的 html 字符串

html - 正确对齐 Div

jquery - 动态居中和分布水平 ul

javascript - 如何在网上商店销售价格上设置价格颜色

html - iframe 在容器内居中并停止调整大小

jquery - mobiscroll 日期/时间.setdate

html - 流体表是否有可能在每个元素之间和外部具有相同的间距?

html - 如何对齐 2 个 div 的左右