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
Sweet Scroll works quite reliably on Desktop, also in horizontal mode. Trouble arises when you use the vertical mode and a navigation (e.g. on mobile) where the navigation expands on click of a navigation button, and obviously hides again after clicking a navigation item.
Even though the header might have a fixed height that doesn't change when navigation pops out, Sweet Scroll uses the height of the content of the specified header element rather than the height of the actual header element. This leads to wrong offsets, especially if you use a full-screen mobile navigation.
How to reproduce:
Have a fixed-height #header (say: 120px) and a button to open the navigation.
Navigation expands to parts or the whole screen after hitting the navigation button, though the height of the container ('#header') remains the same (see Dev Tools).
Click a navigation element, and Sweet Scroll doesn't take into account the header element, but its content, i.e. if the menu spans the whole height, it for some reason stops the viewport height before the actual div, so the element scrolled to isn't visible.
I was able to circumvent it by using a negative offset option using the fixed-header height and setting the 'body' as header option, though it's not too beautiful I assume.
The text was updated successfully, but these errors were encountered:
Sweet Scroll works quite reliably on Desktop, also in horizontal mode. Trouble arises when you use the vertical mode and a navigation (e.g. on mobile) where the navigation expands on click of a navigation button, and obviously hides again after clicking a navigation item.
Even though the header might have a fixed height that doesn't change when navigation pops out, Sweet Scroll uses the height of the content of the specified header element rather than the height of the actual header element. This leads to wrong offsets, especially if you use a full-screen mobile navigation.
How to reproduce:
Have a fixed-height #header (say: 120px) and a button to open the navigation.
Navigation expands to parts or the whole screen after hitting the navigation button, though the height of the container ('#header') remains the same (see Dev Tools).
Click a navigation element, and Sweet Scroll doesn't take into account the header element, but its content, i.e. if the menu spans the whole height, it for some reason stops the viewport height before the actual div, so the element scrolled to isn't visible.
I was able to circumvent it by using a negative offset option using the fixed-header height and setting the 'body' as header option, though it's not too beautiful I assume.
The text was updated successfully, but these errors were encountered: