E
E
Evgeny Kuzovlev2016-07-03 16:33:26
gulp.js
Evgeny Kuzovlev, 2016-07-03 16:33:26

Why is there scrolling after page refresh?

I use gulp and after refreshing the page, it scrolls to the middle of the page, I can’t figure out why and how to remove it.
Part of my gulpfile.js:

gulp.task('server', function () {
  browserSync({
    server: {
      baseDir: './build'
    },
    tunnel: false,
    host: 'localhost',
    port: 9000,
    logPrefix: "test",
    open: false
  });
});

gulp.task('pages', function() {
  return gulp.src(path.in.pages)
    .pipe(rigger())
    .pipe(gulp.dest(path.out.pages))
    .pipe(reload({stream: true}));
});

Now I noticed, at first everything works fine. As soon as I refresh the page myself, there is a problem with the scroll. And several times I updated the page and rolled to different places. It seems that the scroll position is remembered and from some moment it stops updating, it opens all the time in the same place

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zolotykh, 2016-07-03
@Kiyoshi

Perhaps you have a page open in several tabs at the same time?
https://www.browsersync.io/docs/options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question