forked from M-Labs/web2019
fix(mobile/shop): Tries to improvie menu show/hide while scrolling
This commit is contained in:
parent
d08bfbdcc0
commit
72ce996c37
|
@ -219,15 +219,15 @@
|
||||||
mywindow.scroll(function () {
|
mywindow.scroll(function () {
|
||||||
newscroll = mywindow.scrollTop();
|
newscroll = mywindow.scrollTop();
|
||||||
if (!navbarSupportedContent.hasClass('show')) {
|
if (!navbarSupportedContent.hasClass('show')) {
|
||||||
if (newscroll > (mypos + 30) && !up) {
|
if (newscroll > (mypos + 0) && !up) {
|
||||||
$('.container-header').stop().fadeOut();
|
$('.container-header').stop().fadeOut();
|
||||||
up = !up;
|
up = !up;
|
||||||
} else if(newscroll < (mypos + 30) && up) {
|
} else if(newscroll < (mypos + 0) && up) {
|
||||||
$('.container-header').stop().fadeIn();
|
$('.container-header').stop().fadeIn();
|
||||||
up = !up;
|
up = !up;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// mypos = newscroll;
|
mypos = newscroll;
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -27,7 +27,17 @@
|
||||||
(function () {
|
(function () {
|
||||||
function deviceIsMobile() {
|
function deviceIsMobile() {
|
||||||
// https://coderwall.com/p/i817wa/one-line-function-to-detect-mobile-devices-with-javascript
|
// https://coderwall.com/p/i817wa/one-line-function-to-detect-mobile-devices-with-javascript
|
||||||
return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);
|
return (
|
||||||
|
(typeof window.orientation !== 'undefined') ||
|
||||||
|
navigator.userAgent.match(/Android/i) ||
|
||||||
|
navigator.userAgent.match(/webOS/i) ||
|
||||||
|
navigator.userAgent.match(/iPhone/i) ||
|
||||||
|
navigator.userAgent.match(/iPad/i) ||
|
||||||
|
navigator.userAgent.match(/iPod/i) ||
|
||||||
|
navigator.userAgent.match(/BlackBerry/i) ||
|
||||||
|
navigator.userAgent.match(/Windows Phone/i) ||
|
||||||
|
(navigator.userAgent.indexOf('IEMobile') !== -1)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.deviceIsMobile = deviceIsMobile;
|
window.deviceIsMobile = deviceIsMobile;
|
||||||
|
|
Loading…
Reference in New Issue