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 () {
|
||||
newscroll = mywindow.scrollTop();
|
||||
if (!navbarSupportedContent.hasClass('show')) {
|
||||
if (newscroll > (mypos + 30) && !up) {
|
||||
if (newscroll > (mypos + 0) && !up) {
|
||||
$('.container-header').stop().fadeOut();
|
||||
up = !up;
|
||||
} else if(newscroll < (mypos + 30) && up) {
|
||||
} else if(newscroll < (mypos + 0) && up) {
|
||||
$('.container-header').stop().fadeIn();
|
||||
up = !up;
|
||||
}
|
||||
}
|
||||
// mypos = newscroll;
|
||||
mypos = newscroll;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
@ -27,7 +27,17 @@
|
||||
(function () {
|
||||
function deviceIsMobile() {
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user