Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
76473cbc787bdb076cc4ae959e05e91f3505bcc0
1 parent
8bb28c0c
return top logic
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
template/www.yohobuy.com/partials/layout/page-footer.phtml
web-static/js/common.js
web-static/js/footer.js
template/www.yohobuy.com/partials/layout/page-footer.phtml
View file @
76473cb
...
...
@@ -343,7 +343,7 @@
</div>
</div>
</div>
<div class="return-top">
<div class="return-top
hide
">
<span class="iconfont"></span>
</div>
</div>
\ No newline at end of file
...
...
web-static/js/common.js
View file @
76473cb
...
...
@@ -10,8 +10,6 @@ require('./footer');
require
(
'./simple-header'
);
require
(
'./header'
);
function
cookie
(
name
)
{
var
cookies
=
document
.
cookie
,
cookieVal
,
...
...
web-static/js/footer.js
View file @
76473cb
...
...
@@ -6,6 +6,8 @@
var
$
=
require
(
'yoho.jquery'
);
var
$returnTop
=
$
(
'.return-top'
);
var
apiDomain
;
/**
...
...
@@ -126,6 +128,39 @@ function actionhomeFootChange() {
});
}
function
rePosReturn
()
{
if
(
$
(
window
).
height
()
<
$
(
document
).
height
())
{
$returnTop
.
removeClass
(
'hide'
);
}
else
{
$returnTop
.
addClass
(
'hide'
);
}
}
//返回顶部
$returnTop
.
click
(
function
()
{
$
(
'html,body'
).
animate
({
scrollTop
:
0
},
500
);
});
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
===
0
)
{
$returnTop
.
addClass
(
'hide'
);
}
else
{
$returnTop
.
removeClass
(
'hide'
);
}
});
rePosReturn
();
//如果初始是隐藏的,监听图片加载,重新确定return-top的高度
if
(
$returnTop
.
hasClass
(
'hide'
))
{
$
(
'img'
).
load
(
rePosReturn
);
}
//初始化
actionSubscription
();
actionhomeFootChange
();
//暴露给有可能通AJAX改变内容的页面去用
window
.
rePosReturnTop
=
rePosReturn
;
...
...
Please
register
or
login
to post a comment