main
liudan 2 years ago
parent ade46ace56
commit 5528d168f3
  1. 3
      css/index.css
  2. 30
      js/index.js

@ -721,8 +721,7 @@ a:active{
margin-top:30px;
}
.selectContainer{
text-align: left;
text-align: right;
}
.selectContainer>.select{
height: 49px;

@ -301,24 +301,30 @@ $(function(){
url: 'https://suzhou.njrenzhou.cn/api.php/busmap/starProject',
dataType: 'json',
data:{
limit:30
limit:100000
},
success: function (res) {
let data = res.data.data
let firstList = data.slice(0,30);
let secondList = data.slice(30,30);
let thirdList = data.slice(31,30)
console.log(Math.floor(res.data.total/3))
let num = Math.floor(res.data.total/3)
let data = res.data.data
let firstList = data.slice(0,num);
let secondList = data.slice(num,num*2);
let thirdList = data.slice(num*2,num*3)
let html=''
res.data.data.forEach((item,index)=>{
let html1=''
let html2=''
firstList.forEach((item,index)=>{
html+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>`
})
secondList.forEach((item,index)=>{
html1+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>`
})
thirdList.forEach((item,index)=>{
html2+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>`
})
$('.g1 ul').append(html)
$('.g2 ul').append(html)
$('.g3 ul').append(html)
$('.g2 ul').append(html1)
$('.g3 ul').append(html2)
groupSlide()
// console.log(firstList,secondList,thirdList)
}

Loading…
Cancel
Save