When reload a page, it jumps to the top, using turbolinks and overflow hidden on html and body

问题内容:

I have a project on Rails 5.1.4. As it is said in the title of this question, reloading a page causes it to jump to the top of it. But I want the page to stay in the same position that was before reloading. In my css I have these styles:

html {
  overflow: hidden;
}

body {
  overflow-x: hidden;
}

If I comment them, the behaviour of turbolinks is exact as I need. Is there any way to leave these styles and force turbolinks after page reload stay in the same position? Thanks ahead.

问题评论:

原文地址:

https://stackoverflow.com/questions/47748408/when-reload-a-page-it-jumps-to-the-top-using-turbolinks-and-overflow-hidden-on

添加评论