我正在尝试动态附加列表视图(来自 ul --- ul)不起作用。我正在使用 JQM 1.3.0 & phoneGap 2.4.0 代码如下。
<div data-role="content" id='lists'>
<div style="background-color:rgb(248,248,248);" >
<ul data-role="listview" data-inset="true" data-theme='d' style="-webkit-border-radius:5px;">
<li data-icon='false'><a ><p style='position:absolute;left:70px;top:10px;right:3px;bottom:3px;font-size:16px;'><b>Abc Blog</b></p><p style='position:absolute;left:70px;top:30px;right:3px;bottom:3px;font-size:13px;'><i>By: </i><b>xyz</b> <i>4 days ago</i></p><p style='position:absolute;left:70px;top:50px;right:3px;bottom:3px;font-size:13px;'>5 Likes - 3 comments</p><img src="http://172.16.6.54/elgg/mod/profile/icondirect.php?lastcache=1373278757&joindate=1360321536&guid=43&size=medium" class='custom-image' style='position:absolute;left:3px;top:3px;right:3px;bottom:3px;max-height:60px;max-width:60px'/></a></li>
<li style='height:20px' data-icon='false' data-theme='c' >
<table border="0" width='100%' valign="top">
<tr style='height:20px'>
<td width='50%' align='middle' onclick='javascript:likeClicked();'>
<img src="img/unlike.png" style='max-height:20px;max-width:20px' />
</td><td>|</td>
<td width='50%' align='middle' onclick='javascript:likeClicked();'>
<img src="img/like.png" style='max-height:20px;max-width:20px' />
</td>
</tr>
</table></li>
</ul>
</div>
<script>
function addList()
{
var div = document.getElementById('lists');
list = "same code in from <ul -- /ul> as there above";
div.innerHTML =list + div.innerHTML;
$("ul").listview();
}
多谢。