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;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
// var prevScrollpos = window.pageYOffset;
|
||||
// window.onscroll = function () {
|
||||
// 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 (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||
bottomBar.style.bottom = "0px";
|
||||
}
|
||||
else if (currentScrollPos <= 125 && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||
bottomBar.style.bottom = "0px";
|
||||
}
|
||||
else if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) >= (document.body.offsetHeight - 65)) {
|
||||
bottomBar.style.bottom = "-50px";
|
||||
}
|
||||
else {
|
||||
bottomBar.style.bottom = "-50px";
|
||||
}
|
||||
}
|
||||
// if (bottomBar != null) {
|
||||
// if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||
// bottomBar.style.bottom = "0px";
|
||||
// }
|
||||
// else if (currentScrollPos <= 125 && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||
// bottomBar.style.bottom = "0px";
|
||||
// }
|
||||
// else if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) >= (document.body.offsetHeight - 65)) {
|
||||
// bottomBar.style.bottom = "-50px";
|
||||
// }
|
||||
// else {
|
||||
// bottomBar.style.bottom = "-50px";
|
||||
// }
|
||||
// }
|
||||
|
||||
if (topBar != null && dropdown != null) {
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
topBar.style.top = "48px";
|
||||
navbar.classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
topBar.style.top = "48px";
|
||||
navbar.classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
topBar.style.top = "-48px";
|
||||
dropdown.classList.remove('show');
|
||||
navbar.classList.add("shadow");
|
||||
}
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
// if (topBar != null && dropdown != null) {
|
||||
// if (prevScrollpos > currentScrollPos) {
|
||||
// topBar.style.top = "48px";
|
||||
// navbar.classList.remove("shadow");
|
||||
// }
|
||||
// else if (currentScrollPos <= 125) {
|
||||
// topBar.style.top = "48px";
|
||||
// navbar.classList.remove("shadow");
|
||||
// }
|
||||
// else {
|
||||
// topBar.style.top = "-48px";
|
||||
// dropdown.classList.remove('show');
|
||||
// navbar.classList.add("shadow");
|
||||
// }
|
||||
// }
|
||||
// prevScrollpos = currentScrollPos;
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue