一级和二级的列表在一起的时候。获取一级放在轮播里面展示。10个一组轮播
//轮播一级分类
/* $.ajax({
headers: head,
type: "GET",
url: "",
data: {},
dataType: "json",
success: function(rest) {
//console.log(rest);
var parentDataArray = [];
for(var i = 0; i < rest.data.length; i++) {
if(rest.data[i].parentId == "root") { //判断是不是一级
parentDataArray.push(rest.data[i]);
}
}
var ulStart = "<ul class=\"swiper-slide clearfix\">";
var contentHtml = ulStart;
$(parentDataArray).each(function(key, val) {
if(key != 0 && key % 10 == 0) { //获取ul的个数
contentHtml += "</ul>" + ulStart
}
contentHtml += "<li><a href=\"javascript:void(0);\"><img src=\"" + val.pictureUrl + "\"></a><span>" + val.typeName + "</span></li>"; //展示的一个ul里面的是个数
})
contentHtml += "</ul>"
$("#header-list-conent").html(contentHtml);
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
loop: false,
grabCursor: true,
paginationClickable: true,
autoplay: 3000
});
}
});
*/