Skip to content
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

Scrollbar-y is removed on transition #1

Open
trimacdo opened this issue Apr 11, 2017 · 1 comment
Open

Scrollbar-y is removed on transition #1

trimacdo opened this issue Apr 11, 2017 · 1 comment

Comments

@trimacdo
Copy link

https://github.com/JoeeGrigg/barba-transitions/blob/master/src/transition.js#L12
https://github.com/JoeeGrigg/barba-transitions/blob/master/src/transition.js#L69

These two lines were causing my background image & some of the content to resize on each page transition, because the overflow: hidden / visible toggle would remove the scrollbar-y then readd it once the new container was transitioned in.

I removed these two lines completely from the code and everything functioned properly.

I would suggest removing them or adding referencing this issue in the docs.

@trimacdo
Copy link
Author

trimacdo commented Apr 13, 2017

Possibly related to removing this:
https://github.com/JoeeGrigg/barba-transitions/blob/master/src/transition.js#L77

I've changed this line to:

document.documentElement.scrollTop = 0;
document.body.parentNode.scrollTop = 0;
document.body.scrollTop = 0;

This fix supports chrome and IE11 scrolling to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant