miguel-perez / smoothState.js

Unobtrusive page transitions with jQuery.
MIT License
4.43k stars 508 forks source link

Using the back button makes the page jump to the top before the animation #357

Closed arnaudthuillier closed 6 years ago

arnaudthuillier commented 6 years ago

Hello,

First of all, thanks @miguel-perez for that awesome plugin 👍

Here is my problem : Imagine I'm at the bottom of a page, when I click on the back button the page jumps to the top before firing the animation.

Live problem on my website : http://arnaudthuillier.com/ And on the sidebar demo : https://rawgit.com/miguel-perez/smoothState.js/master/demos/sidebar/index.html

I'd just like the current page to stay still before it fires the animation. Is it somehow possible ?

irabronson commented 6 years ago

if ('scrollRestoration' in history) { history.scrollRestoration = 'manual'; }

arnaudthuillier commented 6 years ago

Thank you so much @irabronson !