Answer the question
In order to leave comments, you need to log in
How to make such a menu in the mobile version of the site?
There is a question how the menu is made in the mobile version of the site www.rmchampagnesalon.com ?, namely:
It appears when scrolling from the bottom up.
Thank you.
Answer the question
In order to leave comments, you need to log in
It can be done something like this: jsfiddle.net/IonDen/1orqh5tb
var $win = $(window),
$menu = $('.menu'),
oldY = 0,
y = 0;
function scroll () {
y = $win.scrollTop();
if (y > oldY) {
tglMenu(false);
} else {
tglMenu(true);
}
oldY = y;
}
function tglMenu (state) {
$menu.toggleClass('active', state);
}
$win.on('scroll', scroll);
<div class='test'></div>
<div class='menu'>Menu</div>
.test {
width: 100px;
height: 3000px;
}
.menu {
position: fixed;
bottom: 0; left: 0;
width: 100%;
height: 70px;
background: #f00;
display: none;
}
.menu.active {
display: block;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question