-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let sticky element work inside overflow: scroll containers #47
Comments
If you take a look at the Sticky-kit website, you will see that your statement isnt true, since the examples are working on scrolling divs. |
i have updated that example, but neither i has capable to stick on scrolling div (overflow:scroll), there is another way to do this? regards |
Sorry for the delay. I have updated that example too, and I can't get it to work anyway: |
Having the same issue here & wondered if there was advice on a solution. |
@frenetic if i understand it correctly, the examples on the website are in frames as opposed to divs. also following to see if anyone has come up with a solution for this. |
+1 |
+1, got the same request. |
+1, I'm having the same issue. Website examples look perfect, but they use iframes rather than divs. It would be awesome if this worked on divs with overflow:auto, but I haven't been able to make this work without relying on the body scroll |
+1 |
2 similar comments
+1 |
+1 |
I'm glad this has been acknowledged and set as an enhancement. Any estimate? |
+1 |
hi, can you provide as a demo page, that is easier to understand instead? |
Hi, i've tried this trick with foundation 5 framework sidebar and custom offcanvas with wrapper for whole document with pseudo-scroll (overflow: auto). Change in your source code of sticky kit lib this lines. Change 'win' variable link from window object to your element with scroll. Then edit line 85-90 - code of spacer-wrapper so that its height would be equal the height of your main container (only if you have some bugs with the spacer element and it parent(spacer) gets wrong height). In this case also delete float attribute.
if (spacer) { Optionally, I added location.reload() on resize event on scroll element, because iframes have wrong size after sticky recal method. |
+1 on this. Would a suitable solution involve being able to designate what the overflow container is as an option when initialising the plugin? |
Actually, Waypoints Sticky plugin does this already. For now I've switched to that whenever possible. |
Any update on this? |
I think it stuck. :( |
Is there any way to Stick inside a div instead of body or Let sticky element work inside overflow: scroll containers now? |
@ale24 I'm not aware of a solution in Sticky Kit. As I already said, I've switched to Waypoints Sticky plugin. |
@tegola Do you have any examples with parallel scrolling sidebars in Waypoints Sticky plugin, cause I am not familar with this plugin at all? |
@ale24 What you mean with "parallel scrolling sidebars"? |
@tegola I mean this http://codepen.io/anon/pen/oLQaJW |
I do not have an example for something like that, sorry. Keep in mind that Waypoints' Sticky plugin needs you to make the work for calculating the offsets, while Sticky Kit does them for you (which, I think, is the reason it still doesn't support sticky elements in divs). |
Was there ever any update on this? I still can't use it on any |
+1 |
Hello,
Sticky-Kit relies on the body scroll values to work, but since my web app uses divs as main containers, the body never scroll.
Here's an oversimplified version of what I mean:
http://jsbin.com/yitoheno/4
Is there a workaround for this? Maybe the plugin already accounts for this and I'm missing something?
Thanks!
The text was updated successfully, but these errors were encountered: