Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
biao
9 years ago
Commit
f27f442a7e26d6c3909044b46b611cf0e29d642e
1 parent
2f18a3ac
add wraper only when there is enough elements to wrap. code review by LZF
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
static/js/product/detail/desc.js
static/js/product/detail/desc.js
View file @
f27f442
...
...
@@ -50,9 +50,13 @@ function hiddenTips($ele) {
//}
function
wrapElements
(
selector
,
count
)
{
var
elArr
=
null
;
$
(
selector
).
each
(
function
(
idx
,
el
)
{
if
(
idx
%
count
===
0
)
{
$
(
$
(
selector
).
slice
(
idx
,
idx
+
count
)).
wrapAll
(
$
(
'<div class="js-wraper"></div>'
));
elArr
=
$
(
selector
).
slice
(
idx
,
idx
+
count
);
if
(
elArr
.
length
===
count
&&
idx
%
count
===
0
)
{
$
(
elArr
).
wrapAll
(
$
(
'<div class="js-wraper"></div>'
));
}
});
}
...
...
Please
register
or
login
to post a comment