Answer the question
In order to leave comments, you need to log in
How to make custom accompanying menu for jQuery landing page?
Please help me fix a bug in the menu on mrcanario.com
If you scroll very quickly from the bottom up, the menu does not have time to appear :(
Code:
jQuery(window).scroll(function () {
var top = jQuery(this).scrollTop();
var menu = jQuery('#header-text-nav-container');
if (top < 200) {
menu.stop().css('top', '0px');
}
if (top > 201 && top < 300) {
menu.css('top' , '-70px');
menu.css('position', 'absolute');
}
if (top >= 570 ) {
menu.css('position', 'fixed');
if (menu.css('top') == '-70px') {
menu.stop().animate({
top: 0
}, 200);
}
}
if (top < 570){
if (menu.css('top') == '0px' && menu.css('position') == 'fixed') {
menu.stop().animate({
top: -70
}, 200);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question