In this pen I have a header that is positioned at the top of the page, and once the page scrolls past the banner the header switches to fixed positioning and has a slide down animation. This all works very well, my problem comes with making it slide up once the banner comes back into view again and reposition itself back at the top of the page. The problem with the slide up is that it executes, then immediately after that it removes the fixed positioning so the header goes back up to the top of the page before the slide up animation even becomes noticeable. Any ideas would be greatly appreciated!
Edit: also, doing something like header.slideUp().delay(400).removeClass("fixed");
somehow messes up the sliding down part, making it take about 10 seconds of being past the scroll threshold before it actually slides down. This confuses me the most because these two statements are in separate parts of the if statement.