Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
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
郭成尧
9 years ago
Commit
6c425fdb368d8aaf4329d59e4d331d524934cd49
1 parent
8e2183b9
'滚动条改回去'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
30 deletions
public/scss/common/_common.css
public/vue/me/home.vue
public/vue/product/detail/top-nav.vue
public/vue/product/shop/top-bar.vue
public/scss/common/_common.css
View file @
6c425fd
...
...
@@ -13,19 +13,11 @@
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
}
html
{
height
:
100%
;
width
:
100%
;
overflow
:
hidden
;
body
{
width
:
100%
;
height
:
100%
;
overflow-y
:
scroll
;
font-size
:
24px
;
font-family
:
"PingFang SC"
,
Helvetica
,
Roboto
,
"Heiti SC"
,
"黑体"
,
Arial
;
line-height
:
1.4
;
}
html
,
body
{
font-size
:
24px
;
font-family
:
"PingFang SC"
,
Helvetica
,
Roboto
,
"Heiti SC"
,
"黑体"
,
Arial
;
line-height
:
1.4
;
}
/* stylelint-disable */
...
...
public/vue/me/home.vue
View file @
6c425fd
...
...
@@ -140,16 +140,14 @@
let ghost2 = false;
let ghost3 = false;
let myHeaderTop = $('.my-header').offset().top;
if (myHeaderTop < -40) {
if (window.scrollY > 40) {
ghost = false;
ghost2 = false;
ghost3 = false;
} else if (
myHeaderTop < -
25) {
} else if (
window.scrollY >
25) {
ghost = false;
ghost3 = true;
} else if (
myHeaderTop < -
10) {
} else if (
window.scrollY >
10) {
ghost = false;
ghost2 = true;
}
...
...
@@ -167,17 +165,15 @@
return false;
});
let body = $('body');
body.on('touchmove', () => {
window.addEventListener('touchmove', () => {
this.toggle();
});
body.on
('scroll', () => {
window.addEventListener
('scroll', () => {
this.toggle();
});
body.on
('visibilitychange', () => {
document.addEventListener
('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
...
...
public/vue/product/detail/top-nav.vue
View file @
6c425fd
...
...
@@ -19,7 +19,6 @@
<script>
const yoho = require('yoho');
const cheader = require('component/header.vue');
const $ = require('jquery');
module.exports = {
data() {
...
...
@@ -46,15 +45,15 @@
},
created() {
$('body').on('scroll',
() => {
window.onscroll =
() => {
let transparent = true;
if (
$('.image-carousel').offset().top < -
20) {
if (
window.scrollY >
20) {
transparent = false;
}
this.$refs.header.$el.classList.toggle('ghost', transparent);
}
)
;
};
}
};
</script>
...
...
public/vue/product/shop/top-bar.vue
View file @
6c425fd
...
...
@@ -86,9 +86,9 @@
},
changeTopStatus() {
let topChange = true;
let topHeight =
$('.brand-top-box').offset().t
op;
let topHeight =
document.body.scrollT
op;
if (topHeight
< -2
00) {
if (topHeight
> 1
00) {
topChange = false;
}
...
...
@@ -99,7 +99,7 @@
this.domain = this.shareData.domain;
if (this.shareData.isBlkShop) {
$('body').on('scroll', this.changeTopStatus)
;
window.onscroll = this.changeTopStatus
;
}
}
};
...
...
Please
register
or
login
to post a comment