Hi there,

I have put together some Js to make the header slide up when the user scrolls down and when the scrolls up the header slides back in. Here is the site so you can understand what I mean http://psnew.websitedesignmockup.com/ .

The problem is I want to tell the JS not to hide when scrolling down until about 300 pixels. Also when scrolling down for the header not to scroll up straight away maybe after 5px. I am trying to replicate the mailchimp header as it is pretty awesome. Here is the code I have so far :-

var mywindow = $(window);
var mypos = mywindow.scrollTop();
var up = false;
var newscroll;
mywindow.scroll(function () {
newscroll = mywindow.scrollTop();
if (newscroll > mypos && !up) {
up = !up;
} else if(newscroll < mypos && up) {
up = !up;
mypos = newscroll;