我正在尝试设置这样的列表视图:
http://jquerymobile.com/demos/1.2.0/docs/lists/lists-thumbnails.html
我动态生成我的代码
$('#calendarPage').live('pagebeforeshow', function(event) {
$('#calendarPage').live('pageshow', function(event) {
application.prev = 'menu.html';
//get the actu
application.readFile('calendar.json',function(data){
data = JSON.parse(data);
var listview = '<ul data-role="listview" class="ui-listview" id="calendarList" >';
for(elem in data){
var date = new Date(data[elem].date);
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getYear();
var hours = date.getHours();
var min = date.getMinutes();
var s = date.getSeconds();
listview += '<li>';
listview += '<img src="'+application.api+data[elem].img+'" /><a href="actuOne.html?id='+elem+'" ><h3>'+data[elem].title+'</h3><p>'+day+'/'+month+'/'+year+' '+hours+':'+min+':'+s+'</p></a>';
listview += '</li>';
}
listview += '</ul>';
$('#calendarPage .content').html(listview);
$('#calendarList').listview();
});
});
});
已创建列表视图,但未调整图像大小
我尝试添加 class="ui-li-thumb" 但效果不佳
谢谢