Scrollify icon indicating copy to clipboard operation
Scrollify copied to clipboard

Resize issue

Open bekkr opened this issue 9 years ago • 6 comments

Hello, I've got a problem, when I resize the window, the space between two sections changes. On large resolutions I've got a big space between two blocks, on a narrow I've got a small space, but if i refresh the page the problem disappears. I would really appreciate if you could create a sample of resize function for scrollify.

Currently I'm using that default trigger:

<script> $(function() { $.scrollify({ section : ".example-classname", }); }); </script>

Thanks.

bekkr avatar Oct 12 '16 19:10 bekkr

Scrollify has an internal method that recalculates all section heights and positions on resizing. The issues you're having sound like they are unrelated to Scrollify.

lukehaas avatar Oct 12 '16 20:10 lukehaas

Thank you very much. You were right, the issue came out of "box-sizing: border-box" that was applied to the sections.

bekkr avatar Oct 13 '16 04:10 bekkr

Well, this can be reproduced on the demo page http://www.giphy.com/gifs/7zGkEzeRP73PftWKMR. After resize is performed, sections are not "attached" to the top of the viewport.

vasilii-b avatar Aug 10 '18 08:08 vasilii-b

@lukehaas, about:

Scrollify has an internal method that recalculates all section heights and positions on resizing. The issues you're having sound like they are unrelated to Scrollify.

Yes, that's true. BUT these lines of code says that page offset won't be changed (to see the section in the viewport):

https://github.com/lukehaas/Scrollify/blob/4a40e9c53fab4239a28c6e6c00a999adec77f222/jquery.scrollify.js#L545-L548

That is because its passed false for the scroll param.

Thank you!

vasilii-b avatar Aug 14 '18 13:08 vasilii-b

I confirm what @vasilii-b has reported, this issue has nothing to do with border-box, and it does exists also on the demo page, do you guys have some workaround for it ?

Thanks in advance

s43 avatar Aug 31 '18 11:08 s43

Same issue here. Sections are not attached to the top of the viewport when the viewport changes.

samuel-clara avatar Mar 26 '19 08:03 samuel-clara