Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
xuqi
10 years ago
Commit
e04cad4fb0dea9ea30107fe49b9c8ce40485ddcc
1 parent
b5a550c3
guang info list loadmore
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
static/js/guang/info.js
static/js/guang/info.js
View file @
e04cad4
...
...
@@ -31,10 +31,16 @@ function setLazyLoadAndMellipsis($infos) {
lazyLoad
(
$infos
.
find
(
'img.lazy'
));
$infos
.
each
(
function
()
{
var
$this
=
$
(
this
);
var
$this
=
$
(
this
),
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$this
.
find
(
'.info-title'
)[
0
].
mlellipsis
(
2
);
$this
.
find
(
'.info-text'
)[
0
].
mlellipsis
(
2
);
//减少重复调用
if
(
$title
.
attr
(
'title'
)
&&
$text
.
attr
(
'title'
))
{
return
;
}
$title
[
0
].
mlellipsis
(
2
);
$text
[
0
].
mlellipsis
(
2
);
});
}
...
...
@@ -75,8 +81,6 @@ function initInfosEvt($container) {
* 资讯LoadMore
*/
function
loadMore
(
$container
,
opt
)
{
var
infosNum
=
$container
.
find
(
'.guang-info'
).
length
;
if
(
loading
)
{
return
;
}
...
...
@@ -87,13 +91,10 @@ function loadMore($container, opt) {
loading
=
true
;
$
.
ajax
({
type
:
'
POS
T'
,
type
:
'
GE
T'
,
url
:
' /guang/list/page'
,
data
:
opt
,
success
:
function
(
data
)
{
var
$newInfos
;
//请求结束
if
(
data
===
' '
)
{
opt
.
end
=
true
;
loading
=
false
;
...
...
@@ -104,10 +105,9 @@ function loadMore($container, opt) {
return
;
}
$container
.
append
(
data
);
$newInfos
=
$container
.
find
(
'.guang-info:gt('
+
(
infosNum
-
1
)
+
')'
);
setLazyLoadAndMellipsis
(
$newInfos
);
setLazyLoadAndMellipsis
(
$container
.
find
(
'.guang-info'
));
opt
.
page
++
;
...
...
Please
register
or
login
to post a comment