【问题标题】:jQuery Mobile Add 2 Buttons In List ItemjQuery Mobile 在列表项中添加 2 个按钮
【发布时间】:2013-09-07 12:17:11
【问题描述】:

有谁知道如何在 jQuery Mobile 中向列表项添加按钮。我尝试了以下方法,但它不起作用。

HTML

<ul id="list"></ul>

JS

$('#list').append('<li><h3>Hello</h3><a id="1" data-role="button" data-icon="check" /><a id="2" data-role="button data-icon="delete" /></li');

必须附加代码,因为我从 ajax 调用中获取数据并附加它...我还需要在上面的 JS 代码中添加的两个按钮。

jsFiddle Example

【问题讨论】:

标签: jquery listview button mobile append


【解决方案1】:

下面的示例可以满足您的要求,而不是使用 data-role="button"。

<ul data-role="listview">
    <li><a href="acura.html">Acura</a></li>
    <li><a href="audi.html">Audi</a></li>
    <li><a href="bmw.html">BMW</a></li>
</ul>

http://jsfiddle.net/chamarajanaka/JLVcj/

【讨论】:

  • 对不起,如果我的问题不够清楚,但我想要每个列表项右侧的两个按钮
猜你喜欢
  • 2015-10-19
  • 1970-01-01
  • 2021-06-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多