SlickNav
SlickNav copied to clipboard
Please teach me how to fix position
First, thank you for the great navigation.
I have a question about fixed navigation.
When navigation schroll down, it schroll as well. But when schroll up, I want to make navigation fixed on top of the screen.
This site show me how to do it. http://jsfiddle.net/teddyrised/6zGx6/
the code is like this.
$(document).ready(function() { var previousScroll = 0, headerOrgOffset = $('#header').offset().top;
$('#header-wrap').height($('#header').height());
$(window).scroll(function() { var currentScroll = $(this).scrollTop(); console.log(currentScroll + " and " + previousScroll + " and " + headerOrgOffset); if(currentScroll > headerOrgOffset) { if (currentScroll > previousScroll) { $('#header').fadeOut(); } else { $('#header').fadeIn(); $('#header').addClass('fixed'); } } else { $('#header').removeClass('fixed'); } previousScroll = currentScroll; }); });
I could fixed navigation's position on top of the screen for PC. But I couldn't do it for tablet or smartphone.
I want to add two extra
Will someone teach me how to do this please?
Thank you in advance.