Closed acmoune closed 6 years ago
I got it
<StickyContainer>
<Sticky topOffset={-50}>
({style, isSticky}) => (
<div style={{ ...style, paddingTop: isSticky ? '50px' : '0px' }}>
...
</div>
)
</Sticky>
</StickyContainer>
I had better luck overriding the top vs. the padding top:
<div style={{ ...style, top: '50px' }}>
(you'll need to play around with that if you need a different top value when it's not sticky)
I have a fixed
navbar
, with a height of50px
. I would like to stick when the StickyContainer top is50
, instead of0
. Please how can I acheive that ?