Merge branch 'master' of github.com:hainatravel/information-system into master

master
candice 2 years ago
commit 71c8811ed7

@ -603,10 +603,21 @@
<script>
(function (w, d, i) {
function debounce(func, wait) {
let timeout;
return function() {
const context = this;
const args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}
var navbar = d.getElementById(i);
var prevScrollpos = w.pageYOffset;
w.onscroll = function () {
w.onscroll = debounce(function () {
var currentScrollPos = w.pageYOffset;
if (Math.abs(currentScrollPos - prevScrollpos) > 5) { // 滚动阈值
if (prevScrollpos > currentScrollPos) {
navbar.style.top = '0';
} else {
@ -614,6 +625,7 @@
}
prevScrollpos = currentScrollPos;
}
}, 25) // 防止快速滚动时频繁触发
})(window, document, 'header');
</script>

@ -593,10 +593,21 @@
<script>
(function (w, d, i) {
function debounce(func, wait) {
let timeout;
return function() {
const context = this;
const args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}
var navbar = d.getElementById(i);
var prevScrollpos = w.pageYOffset;
w.onscroll = function () {
w.onscroll = debounce(function () {
var currentScrollPos = w.pageYOffset;
if (Math.abs(currentScrollPos - prevScrollpos) > 5) { // 滚动阈值
if (prevScrollpos > currentScrollPos) {
navbar.style.top = '0';
} else {
@ -604,6 +615,7 @@
}
prevScrollpos = currentScrollPos;
}
}, 25) // 防止快速滚动时频繁触发
})(window, document, 'header');
</script>
<script>/* memu js https://data.chinahighlights.com/js/mobile-menu.js */

@ -421,10 +421,21 @@
<script>
(function (w, d, i) {
function debounce(func, wait) {
let timeout;
return function() {
const context = this;
const args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}
var navbar = d.getElementById(i);
var prevScrollpos = w.pageYOffset;
w.onscroll = function () {
w.onscroll = debounce(function () {
var currentScrollPos = w.pageYOffset;
if (Math.abs(currentScrollPos - prevScrollpos) > 5) { // 滚动阈值
if (prevScrollpos > currentScrollPos) {
navbar.style.top = '0';
} else {
@ -432,6 +443,7 @@
}
prevScrollpos = currentScrollPos;
}
}, 25) // 防止快速滚动时频繁触发
})(window, document, 'header');
</script>

@ -448,12 +448,23 @@
}
</script>
<script>
<script>
(function (w, d, i) {
function debounce(func, wait) {
let timeout;
return function() {
const context = this;
const args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}
var navbar = d.getElementById(i);
var prevScrollpos = w.pageYOffset;
w.onscroll = function () {
w.onscroll = debounce(function () {
var currentScrollPos = w.pageYOffset;
if (Math.abs(currentScrollPos - prevScrollpos) > 5) { // 滚动阈值
if (prevScrollpos > currentScrollPos) {
navbar.style.top = '0';
} else {
@ -461,6 +472,7 @@
}
prevScrollpos = currentScrollPos;
}
}, 25) // 防止快速滚动时频繁触发
})(window, document, 'header');
</script>
<!--移动底部 结束-->

Loading…
Cancel
Save