JoeeGrigg / barba-transitions

(Deprecated) A small library to make css transitions easier with Barba
https://github.com/barbajs/barba
46 stars 5 forks source link

Scrollbar-y is removed on transition #1

Open trimacdo opened 7 years ago

trimacdo commented 7 years ago

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 commented 7 years ago

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.