The element CSS classes xchange whenever the user scrolls from .stash.offto .stash.off.inand from .stash.off.into .stash.offwhen the user scrolls down. CSS selectors .stash, .stash.offand are .stash.indefined as follows:
.stash
{
position: absolute;
visibility: hidden;
-webkit-transition: .35s;
transition: .35s;
-webkit-transform: translate(0, -60px);
transform: translate(0, -60px);
}
.stash.in
{
visibility: visible;
-webkit-transition: .35s;
transition: .35s;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.stash.off
{
position: fixed;
-webkit-transition: .35s;
transition: .35s;
}
Using events scrollto perform transitions using jQuery toggleClass()works flawlessly on desktops and touch devices. But scrollon touch devices it starts touchend, which leads to some delay. To get rid of this delay touchmove, it should be replaced scrollby touch devices.
JS-, scroll, , touchmove. x - . Apple iOS 7 .
Apple, touchmove?
JSFiddle. .