Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
7e05b6c1dfa8bb70df797ec8bb5a040875c8c8b8
1 parent
e2c94bce
Scroll
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
public/js/product/product-list-with-filter.js
public/js/product/product-list-with-filter.js
View file @
7e05b6c
...
...
@@ -67,12 +67,14 @@ class ProductListWithFilter {
/**
* 滚动加载
*/
$
(
window
).
scroll
(
function
()
{
setTimeout
(
function
()
{
$
(
window
).
scroll
(()
=>
{
setTimeout
(()
=>
{
let
afterScroll
=
document
.
body
.
scrollTop
;
if
(
afterScroll
-
this
.
beforeScroll
>
0
)
{
window
.
requestAnimationFrame
(
this
.
scrollHandler
());
window
.
requestAnimationFrame
(()
=>
{
this
.
scrollHandler
();
});
this
.
beforeScroll
=
afterScroll
;
}
else
{
return
false
;
...
...
@@ -341,8 +343,9 @@ class ProductListWithFilter {
* 当scroll到1/2$goodsContainer高度后继续请求下一页数据
*/
scrollHandler
()
{
if
(
this
.
view
.
allGoodsTabPage
.
hasClass
(
'active'
)
&&
$
(
window
).
scrollTop
()
>
this
.
view
.
goodsContainer
.
height
()
*
0.6
)
{
let
goodsContainerHeight
=
this
.
view
.
goodsContainer
.
height
();
if
(
$
(
window
).
scrollTop
()
>
goodsContainerHeight
*
0.6
)
{
this
.
isScrollLoad
=
true
;
this
.
getGoodsList
();
}
...
...
Please
register
or
login
to post a comment