json - jquery mobile ui grid 3 colum -
hello need 3 colums layout in jquery mobile. load json file , need put first obj in ui-block-a second obj in ui-block-b third obj in ui-block-c fourth obj in ui-block-a , on.... can make 2 colums checking if odd or even, code:
for (var in data.cappelli) { if( i%2 == 0)output+="<div class=\"ui-block-a\">" + data.cappelli[i].id + " " + data.cappelli[i].nome + "</div>"; else output+="<div class=\"ui-block-b\">" + data.cappelli[i].id + " " + data.cappelli[i].nome + "</div>"; }
can me achieve in 3 column??
ty much
grids = ['a','b','c']; (var in data.cappelli) { output+="<div class=\"ui-block-" + grids[i%3] + "\">" + data.cappelli[i].id + " " + data.cappelli[i].nome + "</div>"; }
Comments
Post a Comment