diff --git a/css/index.css b/css/index.css index 48ac9f8..4b1f7f8 100644 --- a/css/index.css +++ b/css/index.css @@ -721,8 +721,7 @@ a:active{ margin-top:30px; } .selectContainer{ - text-align: left; - + text-align: right; } .selectContainer>.select{ height: 49px; diff --git a/js/index.js b/js/index.js index 555180a..0ee7c00 100644 --- a/js/index.js +++ b/js/index.js @@ -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+=`
` }) + secondList.forEach((item,index)=>{ + html1+=`` + }) + thirdList.forEach((item,index)=>{ + html2+=`` + }) $('.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) }