fix
This commit is contained in:
parent
623f3ca59a
commit
210da9a8c1
1 changed files with 38 additions and 38 deletions
|
@ -1,44 +1,44 @@
|
||||||
var prevScrollpos = window.pageYOffset;
|
// var prevScrollpos = window.pageYOffset;
|
||||||
window.onscroll = function () {
|
// window.onscroll = function () {
|
||||||
var currentScrollPos = window.pageYOffset;
|
// var currentScrollPos = window.pageYOffset;
|
||||||
|
|
||||||
var topBar = document.getElementById("fixed-bar-mobile");
|
// var topBar = document.getElementById("fixed-bar-mobile");
|
||||||
|
|
||||||
var bottomBar = document.getElementById("mobile-bottom-navigation-bar");
|
// var bottomBar = document.getElementById("mobile-bottom-navigation-bar");
|
||||||
|
|
||||||
var dropdown = document.getElementById("mobileSortDropdown");
|
// var dropdown = document.getElementById("mobileSortDropdown");
|
||||||
|
|
||||||
var navbar = document.getElementById("navbar");
|
// var navbar = document.getElementById("navbar");
|
||||||
|
|
||||||
if (bottomBar != null) {
|
// if (bottomBar != null) {
|
||||||
if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
// if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||||
bottomBar.style.bottom = "0px";
|
// bottomBar.style.bottom = "0px";
|
||||||
}
|
// }
|
||||||
else if (currentScrollPos <= 125 && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
// else if (currentScrollPos <= 125 && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||||
bottomBar.style.bottom = "0px";
|
// bottomBar.style.bottom = "0px";
|
||||||
}
|
// }
|
||||||
else if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) >= (document.body.offsetHeight - 65)) {
|
// else if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) >= (document.body.offsetHeight - 65)) {
|
||||||
bottomBar.style.bottom = "-50px";
|
// bottomBar.style.bottom = "-50px";
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
bottomBar.style.bottom = "-50px";
|
// bottomBar.style.bottom = "-50px";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (topBar != null && dropdown != null) {
|
// if (topBar != null && dropdown != null) {
|
||||||
if (prevScrollpos > currentScrollPos) {
|
// if (prevScrollpos > currentScrollPos) {
|
||||||
topBar.style.top = "48px";
|
// topBar.style.top = "48px";
|
||||||
navbar.classList.remove("shadow");
|
// navbar.classList.remove("shadow");
|
||||||
}
|
// }
|
||||||
else if (currentScrollPos <= 125) {
|
// else if (currentScrollPos <= 125) {
|
||||||
topBar.style.top = "48px";
|
// topBar.style.top = "48px";
|
||||||
navbar.classList.remove("shadow");
|
// navbar.classList.remove("shadow");
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
topBar.style.top = "-48px";
|
// topBar.style.top = "-48px";
|
||||||
dropdown.classList.remove('show');
|
// dropdown.classList.remove('show');
|
||||||
navbar.classList.add("shadow");
|
// navbar.classList.add("shadow");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
prevScrollpos = currentScrollPos;
|
// prevScrollpos = currentScrollPos;
|
||||||
}
|
// }
|
Loading…
Add table
Add a link
Reference in a new issue