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
xuqi
9 years ago
Commit
8d8495526eddbcba45a230fd5a9dd5aa86a780db
1 parent
a2e9b474
scroll with header
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
static/js/guang/detail.js
static/sass/guang/_detail.scss
static/sass/layout/_header.scss
static/js/guang/detail.js
View file @
8d84955
...
...
@@ -163,14 +163,21 @@ exports.init = function (flag) {
// 初始化iscroll
window
.
onload
=
function
()
{
var
$scroller
=
$
(
'#scroller'
);
var
$scroller
=
$
(
'#scroller'
),
$yohoHeader
=
$
(
'.yoho-header'
);
var
winH
,
tcH
,
cbH
,
cbTop
,
fixedThumbDom
;
var
hH
=
0
,
winH
,
tcH
,
cbH
,
cbTop
,
fixedThumbDom
;
if
(
!
isIphone
||
isEzinPage
)
{
return
;
}
//考虑通用头部的影响:对offset().top以及winH做对应偏移
if
(
$yohoHeader
.
length
>
0
)
{
hH
=
$yohoHeader
.
outerHeight
();
}
myScroll
=
new
IScroll
(
'#wrapper'
,
{
probeType
:
3
,
mouseWheel
:
true
,
...
...
@@ -188,12 +195,12 @@ window.onload = function() {
return
;
}
winH
=
$
(
window
).
height
();
winH
=
$
(
window
).
height
()
-
hH
;
fixedThumbDom
=
$fixedThumbContainer
[
0
];
tcH
=
$thumbContainer
.
height
();
cbH
=
$coBlock
.
height
();
cbTop
=
$coBlock
.
offset
().
top
;
tcH
=
$thumbContainer
.
outerHeight
();
cbH
=
$coBlock
.
outerHeight
();
cbTop
=
$coBlock
.
offset
().
top
-
hH
;
myScroll
.
on
(
'scroll'
,
function
()
{
var
sTop
=
-
this
.
y
;
...
...
@@ -224,7 +231,7 @@ window.onload = function() {
.
addClass
(
'absolute'
)
.
removeClass
(
'fixed-top hide'
);
}
fixedThumbDom
.
style
.
top
=
cbTop
+
cbH
-
tcH
-
sTop
+
'px'
;
fixedThumbDom
.
style
.
top
=
cbTop
+
hH
+
cbH
-
tcH
-
sTop
+
'px'
;
}
else
if
(
sTop
>
cbTop
+
cbH
)
{
if
(
classList
.
indexOf
(
'hide'
)
===
-
1
)
{
$fixedThumbContainer
...
...
static/sass/guang/_detail.scss
View file @
8d84955
...
...
@@ -38,6 +38,10 @@ $clothes: sprite-map("guang/clothes/*.png");
&
.has-head
{
top
:
90rem
/
$pxConvertRem
;
+
.fixed-top
{
top
:
90rem
/
$pxConvertRem
;
}
}
}
...
...
static/sass/layout/_header.scss
View file @
8d84955
...
...
@@ -6,6 +6,7 @@
overflow
:
hidden
;
height
:
90rem
/
$pxConvertRem
;
line-height
:
90rem
/
$pxConvertRem
;
z-index
:
1
;
&
.boys
{
@include
background-image
(
linear-gradient
(
#323232
,
#414141
));
...
...
Please
register
or
login
to post a comment