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
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
1d2eda7e3e99de1eeb8644ed7d1e8dd62cab1abd
2 parents
3cb2ed15
55b35313
Merge branch 'bugfix' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
static/js/category/brand.js
static/js/category/brand.js
View file @
1d2eda7
...
...
@@ -8,7 +8,8 @@ var $ = require('yoho.zepto'),
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.zeptolazyload'
);
var
swiper
;
var
swiper
,
$brandList
=
$
(
'.brand-list'
);
swiper
=
new
Swiper
(
'.swiper-container'
,
{
lazyLoading
:
true
,
...
...
@@ -22,4 +23,27 @@ $('.yoho-header').css({
'z-index'
:
2
,
position
:
'fixed'
});
$
(
'.banner-top'
).
css
(
'padding-top'
,
'90px'
);
\ No newline at end of file
$
(
'.banner-top'
).
css
(
'padding-top'
,
'90px'
);
if
(
$brandList
.
length
>
0
)
{
$
(
window
).
scroll
(
function
()
{
var
scrTop
=
$
(
window
).
scrollTop
(),
searchH
=
$
(
'.newbrand-search'
).
height
(),
headerH
=
$
(
'.yoho-header'
).
height
(),
brandSwipe
=
parseInt
(
searchH
)
+
parseInt
(
headerH
);
$
(
'.brand-list'
).
each
(
function
()
{
var
offTop
=
$
(
this
).
offset
().
top
-
brandSwipe
;
if
(
scrTop
>=
offTop
)
{
$brandList
.
find
(
'.title-bar'
).
css
(
'position'
,
'static'
);
$
(
this
).
find
(
'.title-bar'
).
css
({
position
:
'fixed'
,
top
:
brandSwipe
});
}
else
{
$
(
this
).
find
(
'.title-bar'
).
css
(
'position'
,
'static'
);
}
});
});
}
...
...
Please
register
or
login
to post a comment