Answers for "akhil insta scroll"

0

akhil insta scroll

//scroll div for a time 
function scrollDiv(_timeOut,_htmlElement){
    let interval = setInterval(function(){
        var objDiv = document.getElementsByClassName(_htmlElement)[0];
        objDiv.scrollTop = objDiv.scrollHeight;
        console.log("scrolling.")
    },2000)

    setTimeout(function(){
        clearInterval(interval);
        console.log("***** interval cleared *****")
    },_timeOut)
}
scrollDiv(500000,"isgrP") //working
Posted by: Guest on October-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language