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
069c4ee6dbc60e06a91f69ab2a46fe32335f3962
1 parent
305f527f
解决加入购物车弹窗出现时,页面滑动问题. code review by LZF
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
static/js/cart/chose-panel.js
static/js/cart/chose-panel.js
View file @
069c4ee
...
...
@@ -32,6 +32,7 @@ var $chosePanel = $('#chose-panel'),
queryString
,
$yohoPage
=
$
(
'.yoho-page'
);
//初始化购物车面板显示
function
init
()
{
hasChooseColor
=
false
;
...
...
@@ -60,7 +61,19 @@ function checkColorSizeNum() {
return
true
;
}
function
show
(
html
,
cb
)
{
var
scrollPosition
=
[
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
.
data
(
'scroll-position'
,
scrollPosition
);
$html
.
data
(
'previous-overflow'
,
$html
.
css
(
'overflow'
));
$html
.
css
(
'overflow'
,
'hidden'
);
window
.
scrollTo
(
scrollPosition
[
0
],
scrollPosition
[
1
]);
if
(
html
)
{
$chosePanel
.
html
(
html
);
if
(
$
(
'#promotionId'
).
val
()
!==
''
)
{
...
...
@@ -76,6 +89,12 @@ function show(html, cb) {
//隐藏当前Panel
function
hide
()
{
var
$html
=
$
(
'html'
),
scrollPosition
=
$html
.
data
(
'scroll-position'
);
// un-lock scroll position
$html
.
css
(
'overflow'
,
$html
.
data
(
'previous-overflow'
));
window
.
scrollTo
(
scrollPosition
[
0
],
scrollPosition
[
1
]);
$
(
'.chose-panel'
).
hide
();
}
...
...
Please
register
or
login
to post a comment