How do sites like this change urls seamlessly?
If you scroll on this link it animates a transition and the url changes from:
http://www.e-types.com/
to
http://www.e-types.com/work
And if you click the logo it transitions back without any flicker or loading time. Any ideas what method they're using?
Thanks for your time.
The idea behind is that there is only one page (single-page application).
The change in URL is handled by the History API, as mentionned in the comments : https://developer.mozilla.org/en-US/docs/Web/API/History_API
But it only changes the address, it does not actually load a full document. So the javascript can do any transition it wants on the content.
There is plenty of libraries that offer this feature.
More specificly, the linked site uses AngularJS.
You can find a complete example of ng-animate + router at this address: https://github.com/cornflourblue/ng-animate-ui-router-example
Depending on what you need, you can use a simple scroll with: https://github.com/oblador/angular-scroll
You can also do similar things with other popular tools:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With