照片墙优化
This commit is contained in:
parent
731f80f631
commit
4a3731db41
@ -198,6 +198,8 @@ function loadMoreItems(step) {
|
|||||||
groupid++
|
groupid++
|
||||||
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
||||||
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
||||||
|
let tempIndex = currentIndex
|
||||||
|
currentIndex = 0
|
||||||
loadMoreItems(currentIndex + step - index)
|
loadMoreItems(currentIndex + step - index)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"description": "Hexo响应式主题",
|
"description": "Hexo响应式主题",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack --watch --mode development",
|
"dev": "webpack --watch --progress --mode development",
|
||||||
"build": "webpack -p --mode production"
|
"build": "webpack -p --mode production"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@ -34,7 +34,9 @@ function loadMoreItems(step) {
|
|||||||
groupid++
|
groupid++
|
||||||
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
||||||
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
||||||
loadMoreItems(currentIndex + step - index)
|
let tempIndex = currentIndex
|
||||||
|
currentIndex = 0
|
||||||
|
loadMoreItems(tempIndex + step - index)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentIndex = index
|
currentIndex = index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user