0

我想使用 jquery-mobile 动态创建列表。我有 ul 作为

<ul data-role="listview" id="bList"></ul>

我正在使用模板向其中动态添加列表项:

<li id="someid" data-wrapperels="div" data-shadow="false" data-icon="false">
    <a href="#">some text</a>
</li>

附加li到列表后,我正在调用

$('#bList').listview('refresh');

这将创建列表并显示出来。li但未显示默认的 jquery 移动样式。它将只读列表显示为http://jquerymobile.com/demos/1.2.1/docs/lists/lists-readonly.html

尽管指定了内容,但内容也不包含在 div 中data-wrapperels="div"。我希望列表看起来像http://jquerymobile.com/demos/1.2.1/docs/lists/lists-ul.html

我也尝试过显示静态列表,但仍然没有应用样式。请帮忙。谢谢。

4

1 回答 1

-1
$('#bList').listview('refresh');
$('#bList').trigger("create");
于 2013-11-11T10:25:32.740 回答