You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @jackmoore thanks for the great little pollyfill!
I have a slight problem with it - I am using a long container to stick a block of content to the page as you scroll down. Firefox's position: sticky will move down until the inner element (primary per your vernacular) hits the bottom of the wrapper, and then stops. In your implementation, the content keeps on going.
Here is how firefox (native position: sticky) handles that:
And here is chrome (your implementation):
Your code uses position: fixed which I think is most of the problem. I think a correct implementation here would use position: absolute and have to adjust the top on every scroll - until it reached the bottom of the container.
If you'd like @jackmoore - I can spend a bit of time working on a fix and PR it. If you're happy that I go forward with the suggestion outlined above.
The text was updated successfully, but these errors were encountered:
keithamus
added a commit
to keithamus/sticky-position
that referenced
this issue
Apr 18, 2016
This fix sets the top to a maximum of the wrapper's container height,
minus the height of the primary element. In other words, the primary
cannot move beyond its parent container. This is truer to the behaviour
of `position: sticky` in browsers that support it.
Fixesjackmoore#4
Hey @jackmoore thanks for the great little pollyfill!
I have a slight problem with it - I am using a long container to stick a block of content to the page as you scroll down. Firefox's
position: sticky
will move down until the inner element (primary
per your vernacular) hits the bottom of the wrapper, and then stops. In your implementation, the content keeps on going.To illustrate, I've knocked up a quick jsbin, which you can visit here: http://jsbin.com/ruwokecofu/edit?html,css,js.
Here is how firefox (native position: sticky) handles that:
And here is chrome (your implementation):
Your code uses
position: fixed
which I think is most of the problem. I think a correct implementation here would useposition: absolute
and have to adjust thetop
on every scroll - until it reached the bottom of the container.If you'd like @jackmoore - I can spend a bit of time working on a fix and PR it. If you're happy that I go forward with the suggestion outlined above.
The text was updated successfully, but these errors were encountered: