I can not understand why the scroll does not remember its position.
Memorization works on the page /ajax/select/dialog.php
<script> window.addEventListener('DOMContentLoaded', function() { var div = document.querySelector('#slider'); var scroll = localStorage.getItem('scroll')||0; div.scrollTop = scroll; div.addEventListener('scroll', function() { localStorage.setItem('scroll', div.scrollTop); }) }); </script> Next, on another page, I display the /ajax/select/dialog.php script:
<script> function show() { $.ajax({ url: "../../ajax/select/dialog.php", cache: true, success: function(html){ $("#dtr").html(html); } }); } $(document).ready(function(){ show(); setInterval('show()',3000); }); </script> And memorization does not work, every 3 specified seconds the page jerks up.
Tell me how to be in this situation.