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
{{ message }}
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
I have a fixed element inside a scrollable container, to make this work I had to put "ui-scrollpoint-target" in the container. This works great in a desktop.
The problem is, when the page is in a mobile screen size, the container no longer controls the scroll, now the body is controlling the scroll and the fixed element doesn't work, probably because is listening to the "ui-scrollpoint-target" of the container that is no longer controlling the scroll.
Any advice on this? Thanks!
The text was updated successfully, but these errors were encountered:
W3 standards state that fixed element position is relative to the viewport, not to a scrollable container. While you might find that it works on certain browsers, you should definitely not rely on it to be cross-compatible.
What I've done in the case of having an element "stick" to the top of a scrollable div is to set its position: absolute; and watch the scroll event on the scrollable div (potentially a ui-scrollpoint-target) to update the element's top value.
You probably could try the ui-scrollpoint-pin module. Last I recall it was working pretty nicely, but I ended up abandoning the project because I found it to be overkill and I wrote something more specialized into my ui framework.
Yes, as I said, the sticky element is working with ui-scrollpoint-target, the problem is when that container is no longer controlling the scroll because the screen size is too small and the whole page/body starts controlling the scroll.
I haven't found something to explain how ui-scrollpoint-absolute works, maybe that can help?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I have a fixed element inside a scrollable container, to make this work I had to put "ui-scrollpoint-target" in the container. This works great in a desktop.
The problem is, when the page is in a mobile screen size, the container no longer controls the scroll, now the body is controlling the scroll and the fixed element doesn't work, probably because is listening to the "ui-scrollpoint-target" of the container that is no longer controlling the scroll.
Any advice on this? Thanks!
The text was updated successfully, but these errors were encountered: