This is what I am trying to do:
- Show
div
when.scrollTop() > 20
fadeOut
after delay- Stop
fadeOut
when a :hover
sticky footer
This is my jquery:
$(function () {
var targets = $(".footer-nav");
if ($(window).scrollTop() > 20) {
$(this).addClass('show');
}
$(window).scroll(function () {
var pos = $(window).scrollTop();
if (pos > 10) {
targets.stop(true, true).fadeIn("fast").delay(2000).fadeOut(2000);
} else {
targets.stop(true, true).fadeOut();
}
});
});
I have problems with point .3 . Also, when I move the scroll wheel very quickly, the sticky footer flickers. Is there a way to optimize / improve . Jsfiddle here. Thanks.
source
share