如何在jquery中创建自定义列表?

时间:2014-02-12 08:16:12

标签: jquery css3 jquery-mobile

你可以告诉我如何让它看起来如图所示 我制作了80%的列表,但它看起来不像图像。

http://jsfiddle.net/3kHn9/

var name = new Array();
name[0] = "10000";
name[1] = "20750";
name[2] = "80485";
name[3] = "41185";
name[4] = "78596";

var address = new Array();
address[0] = "Ammer Computer GmbH";
address[1] = "c-entron software gmbh"; 
address[2] = "Computersysteme Mayer";
address[3] = "Fischer Pc";
address[4] = "Kaisher IT systemeAG";

$(document).ready(function () {
    for(var i=0;i<name.length;i++){
        $('#folderData').append('<li class="rowclick" id="'+i+'"><p>'+name[i]+'</p><p>'+address[i]+'</p></li>');
    }

    // Refreshing the list
    $('#folderData').listview('refresh');
}); 

由于

1 个答案:

答案 0 :(得分:0)

更新一些css。

DEMO http://jsfiddle.net/3kHn9/5/

CSS

#folderData {
    float:left;
    margin:2%;
    width:96%;
}
#folderData li {
    margin:10px 0px;
    border :1px solid #ddd;            
    background:#fff url(https://cdn1.iconfinder.com/data/icons/icojoy/noshadow/transparent/png/24x24/001_15.png) no-repeat right center;
}