Automatically scroll to bottom when subscribing in footer
P粉550823577
P粉550823577 2023-09-15 10:03:57
0
1
394

When I am in the footer and submit the form, it redirects to another page but it automatically srcolls to the footer

Now I want it not to scroll, is there any way? I tried using window.scrollToTop but it doesn't work, it still scrolls to the bottom then to the top

P粉550823577
P粉550823577

reply all(1)
P粉877114798

I believe this only happens in Chrome!

Can you try adding the following auto-scroll limit in the head tag?

<script>
  window.history.scrollRestoration = 'manual';
</script>

Setting to manual value will not automatically scroll on page load/reload.

refer to: https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!