Example: http://www.arkansasmatters.com/beta/news/politics
I have a simple javascript that keeps a fixed header on the website. When scrolling up, the header on a rare occasion will show this red bar which will disappear if you continue scrolling up.
function stickynav() {
var win = $(window),
nav = $('#primary_nav_wrap'),
pos = nav.offset().top,
sticky = function () {
win.scrollTop() > pos ? nav.addClass('sticky') : nav.removeClass('sticky');
};
win.scroll(sticky);
}
Is there a reason that this script would cause the following:
- Blank Bar on scrolling up
- Flickering while scrolling down
Additional Informaation:
- Browser: Google Chrome
- User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Alternatively: Is there another IE7+ Cross Browser solution similar to this that I missed?
Update
This issue is replicable if a user quickly scrolls up and down. Calling the JS function over and over again.