jQuery mobile listview - 在右侧添加一些文本

标签 jquery jquery-mobile

我刚刚开始使用jquery mobile,所以请耐心等待。我正在尝试创建一个 ListView ,其中商品的价格在右侧对齐(商品的描述在左侧对齐 - 这部分工作正常)。

我在互联网上进行了搜索,但找不到任何可以帮助我的内容。

这是我的代码:

<div id="home" data-role="page">
    <div data-role="header">
            <h1>For sale</h1>
    </div>

    <div data-role="content">   
        <ul data-role="listview" data-inset="true" data-filter="false">
            <li><a href="#itemA">A</a></li>   <!-- want to put a right-aligned price in here!-->
            <li><a href="#itemB">B</a></li>
            <li><a href="#itemC">C</a></li>
            <li><a href="#itemD">D</a></li>
            <li><a href="#itemE">E</a></li>
        </ul>
    </div>
</div>

最佳答案

另一个想法:您可以添加一个 2 列网格,请参见此处 http://jquerymobile.com/test/docs/content/content-grids.html

Two column grids

To build a two-column (50/50%) layout, start with a container with a class of ui-grid-a, and add two child containers inside it classed with ui-block-a for the first column and ui-block-b for the second:

<div class="ui-grid-a">
    <div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div>
    <div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div>
</div><!-- /grid-a -->

Grid classes can be applied to any container

关于jQuery mobile listview - 在右侧添加一些文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13149490/

相关文章:

jquery - 如何将 Json 数据导入 Jquery 移动应用程序

android - Phonegap 电话 : uri not working on android even after whitelisting

jquery - 对 div 进行排序后,悬停事件停止工作

javascript - 如果未选中复选框,则隐藏标签和 img

jquery - 如何在jquery mobile中居中元素

css - 背景图像在桌面浏览器上正确显示,在移动浏览器上不显示

javascript - 将 javascript 脚本附加到 head 不起作用

javascript - 使用 jquery 创建了一个简单的 BREAKOUT 游戏,尝试转换回纯 JavaScript

javascript - jQuery 之后的文本格式问题

jQuery 手机 : Scroll only the listview