This script automatically scrolls to the bottom of the page
1- How do I scroll to a specific {Div} in the middle of the page only and auto scroll gets disabled
2- If the user scrolls down from the computer or phone manually, the automatic descent will be disabled
function scrollpage() {
function f()
{
window.scrollTo(0,i);
if(status==0) {
i=i+0.1;
if(i>=Height){ status=1; }
} else {
}
setTimeout( f, 0.5 );
}f();
}
var Height=document.documentElement.scrollHeight;
var i=1,j=Height,status=0;
scrollpage();
<div style=" background: #f00; width: 100%; height: 100vh; "></div>
<div style=" background: #000; width: 100%; height: 100vh; "></div>
<div style=" background: #2700ff; width: 100%; height: 100vh; "></div>