Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
3abd66dfe2c5a5bd50755e7d9032b20e558b68f6
1 parent
a53ef2e3
product desc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
static/js/product/detail/desc.js
static/js/product/detail/desc.js
View file @
3abd66d
...
...
@@ -4,23 +4,16 @@
* @date: 2015/11/18
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
loading
=
require
(
'../../plugin/loading'
)
;
var
loading
=
require
(
'../../plugin/loading'
)
,
tip
=
require
(
'../../plugin/tip'
);
var
introUrl
=
$
(
'#introUrl'
).
val
(),
winH
=
$
(
window
).
height
(),
$productDesc
,
searching
=
false
,
end
=
false
,
num
;
function
scrollHandler
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>=
$
(
document
).
height
()
-
50
)
{
search
();
}
}
end
=
false
;
function
search
()
{
if
(
searching
||
end
)
{
...
...
@@ -34,7 +27,7 @@ function search() {
type
:
'GET'
,
url
:
introUrl
,
success
:
function
(
data
)
{
var
$productDesc
=
$
(
'#productDesc'
);
$productDesc
=
$
(
'#productDesc'
);
$productDesc
.
append
(
data
);
lazyLoad
(
$productDesc
.
find
(
'img.lazy'
));
...
...
@@ -51,8 +44,14 @@ function search() {
});
}
function
scrollHandler
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>=
$
(
document
).
height
()
-
50
)
{
search
();
}
}
//srcoll to load more
$
(
window
).
scroll
(
function
()
{
$
(
window
).
scroll
(
function
()
{
window
.
requestAnimationFrame
(
scrollHandler
);
});
...
...
Please
register
or
login
to post a comment