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
biao
9 years ago
Commit
42d653e3a3ebe65107ccd447535cb6615d707c89
1 parent
35051590
解决购物车页面弹出时,商品详情页会滚动的问题。 code review by BIKAI.
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
static/js/cart/chose-panel.js
static/js/cart/chose-panel.js
View file @
42d653e
...
...
@@ -67,11 +67,12 @@ function show(html, cb) {
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
,
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
],
$html
=
$
(
'html'
);
// it would make more sense to apply this to body, but IE7 won't have that
$html
=
$
(
'html
, body
'
);
// it would make more sense to apply this to body, but IE7 won't have that
$html
.
data
(
'scroll-position'
,
scrollPosition
);
$html
.
data
(
'previous-overflow'
,
$html
.
css
(
'overflow'
));
$html
.
css
(
'overflow'
,
'hidden'
);
$html
.
css
(
'height'
,
'100%'
);
window
.
scrollTo
(
scrollPosition
[
0
],
scrollPosition
[
1
]);
if
(
html
)
{
...
...
@@ -89,11 +90,12 @@ function show(html, cb) {
//隐藏当前Panel
function
hide
()
{
var
$html
=
$
(
'html'
),
var
$html
=
$
(
'html
, body
'
),
scrollPosition
=
$html
.
data
(
'scroll-position'
);
// un-lock scroll position
$html
.
css
(
'overflow'
,
$html
.
data
(
'previous-overflow'
));
$html
.
css
(
'height'
,
'auto'
);
window
.
scrollTo
(
scrollPosition
[
0
],
scrollPosition
[
1
]);
$
(
'.chose-panel'
).
hide
();
}
...
...
Please
register
or
login
to post a comment