Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var router = Router.create({
  2. routes: routes,
  3. location: Router.HistoryLocation,
  4. scrollBehavior: {
  5. updateScrollPosition: function updateScrollPosition() {
  6. var hash = window.location.hash;
  7. if (hash) {
  8. var element = document.querySelector(hash);
  9. if (element) {
  10. element.scrollIntoView();
  11. }
  12. } else {
  13. window.scrollTo(0, 0);
  14. }
  15. }
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement