Open DavidScanu opened 9 years ago
Same issue, only that I have the same issue as another thread where the stick-end isn't triggering
Finding what it did in v1.0.2 where is doesn't update the height value on scroll. So commented out that line. Might be better to have it as a option
https://github.com/Zackio/sticky/blob/master/jquery.sticky.js
Which line did you comment ?
In my folk above line 54
Thanks a lot. It is working now. I did comment this line : s.stickyWrapper.css('height', s.stickyElement.outerHeight());
Can you explain to me what is going on here ?
I have a navbar :
masthead { height: 130px; }
.is-sticky #masthead { height: 80px; }
So when user scrolls, the navbar's height goes from 130 px to 80 px.
But when scrolling back to the top of the page (initial state of the element), which correspond the event "sticky-end", Sticky JS puts an inline style of 'height: 80px' to the 'masthead-sticky-wrapper' element.
I did a quick fix like this, but not optimal at all :
$('#masthead').on('sticky-end', function() { $('#masthead-sticky-wrapper').css('height', '130px' ); });