Answers for "scrolltop in js"

0

jquery keep scroll position

var scroll = $(window).scrollTop();
// yada
$("html").scrollTop(scroll);
Posted by: Guest on March-30-2020
1

html scroll div to top

var myDiv = document.getElementById('containerDiv');
myDiv.innerHTML = variableLongText;
myDiv.scrollTop = 0;
Posted by: Guest on June-07-2020

Browse Popular Code Answers by Language