WickyNilliams / headroom.js

Give your pages some headroom. Hide your header until you need it
https://wicky.nillia.ms/headroom.js/
MIT License
10.86k stars 824 forks source link

Scroll down, up and down again uses pinned instead of unpinned #233

Closed slacto closed 7 years ago

slacto commented 8 years ago

I included the script like ths:

    $('.js-header').headroom({
        'offset': 150,
        'tolerance': 5,
        'classes': {
            'initial': 'animated',
            'pinned': 'slideDown',
            'unpinned': 'slideUp'
        }
    });

Scroll down headroom--top headroom--not-bottom headroom--not-bottom headroom--not-top slideUp

Scroll up headroom--not-bottom headroom--not-top slideDown headroom--not-bottom slideDown headroom--top

Scroll down again headroom--not-bottom slideDown headroom--top headroom--not-bottom headroom--not-top slideUp

I don't understand why 'slideDown' is set when I scroll down again. It makes this state hard to style. As I see it classes should be the same whenever I scroll down.

slacto commented 8 years ago

How do I avoid the 'pinned' class second time I scroll down / slide up? It should only be 'pinned' when I scroll up / slide down, right?

WickyNilliams commented 7 years ago

I was not able to reproduce this. I'm closing this in the interest of cleaning up the issue tracker. If you are still having problems, or can provide a reduced test case, please comment here